Access production ready models#
You can access and download model files based on their stage using the fetch_model_versions_table()
method.
The following example illustrates how to download production-stage model files.
Assumptions
- There exists a model with the ID
CLS-PRE
, which has at least one version with the stage set to"production"
. - There are model binaries stored in the
"model/binary"
field of the model version.
-
Initialize a registered model and fetch its versions:
model = neptune.init_model( with_id="CLS-PRE", # (1)! ) model_versions_df = model.fetch_model_versions_table().to_pandas()
- The Neptune ID of the model
How do I find the ID?
The Neptune ID is a unique identifier for the run. The Experiments tab displays it in the leftmost column.
In the run structure, the ID is stored in the system namespace (
sys
).-
If the run is active, you can obtain its ID with
run["sys/id"].fetch()
. For example: -
If you set a custom run ID, it's stored at
sys/custom_run_id
:
-
Filter the pandas DataFrame for model versions with the stage set to "production":
-
Initialize each model version and download the files from the
model/binary
field: