How to call a model's artifacts (pickeled vectorizer) when the model is on Production in databricks?

Viewed 10

I am using databrick, machine learning view. I have successfully created and saved my model and also logged my pickled vectorizer as artifacts to it. I would like to load it in a different notebook; the model and the artifacts belong to the model which is currently in production.

   import mlflow.pyfunc

model_name = "Sentiment"
stage = 'Production'

model = mlflow.pyfunc.load_model(
    model_uri=f"models:/{model_name}/{stage}"
)

So this code seems to be working but it does not load the artifacts or if it does, i do not know how to display them.

I have found this code but not sure what to do with it to only get the artifacts from the model which is in Production.

  from mlflow.store.artifact.models_artifact_repo import ModelsArtifactRepository
version =1
model_uri = MlflowClient.get_model_version_download_uri(name=model_name, version=version)
ModelsArtifactRepository(model_uri).download_artifacts(artifact_path="")

even when i run this i get an error :

TypeError: get_model_version_download_uri() missing 1 required positional argument: 'self'

0 Answers
Related