Download Models from the Machine Learning Repository using the FrogML SDK

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

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.

frogml-local

<NAMESPACE_NAME>

(Optional) The name of the namespace or organization: use this parameter to group models by project or group.

frog-ml-beta

<MODEL_NAME>

The name of the model you want to download.

my-cool-model

<MODEL_VERSION>

The version of the model you want to download.

1.0.0

<TARGET_PATH>

The file path to where you want to download the model.

/root/models/

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.