You can use the frogml.load_model() function to download a model from an Artifactory repository. This method will download the model file locally and return the path to the returned model.
import frogml # Download model version frogml.files.load_model( repository="<REPOSITORY_KEY>", # The name of the JFrog repository you want to download the model from namespace="<NAMESPACE_NAME>", # Optional. The name of the namespace or organization: use this parameter to group models by project or group. model_name="<MODEL_NAME>", # The name of the model you want to download. version="<MODEL_VERSION>", # The version of the model you want to download. target_path="<FILE_PATH>", # The file path to where you want to download the model. )
Note
Make sure to replace the placeholders in bold with your own JFrog repository key, namespace name, model name, target path, and version.
Parameters
Parameter | Description | Example |
---|---|---|
<REPOSITORY_KEY> | The name of the JFrog repository you want to download the model from. |
|
<NAMESPACE_NAME> | (Optional) The name of the namespace or organization: use this parameter to group models by project or group. |
|
<MODEL_NAME> | The name of the model you want to download. |
|
<MODEL_VERSION> | The version of the model you want to download. |
|
<TARGET_PATH> | The file path to where you want to download the model. |
|
Example
import frogml # Download model version frogml.files.load_model( repository="frog-ml-local", namespace="frog-ml-beta", #optional model_name="my-cool-model", version="1.0.0" target_path="~/root/models/", )
Return Value
The load_model()
method returns the path to the local downloaded model as a Path object imported from pathlib
.