cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

utils.add_libraries_to_model creates a duplicated model

pablobd
Contributor II

Hello,

When I call this function,

mlflow.models.utils.add_libraries_to_model(MODEL_URI)

It register a new model into the Model Registry. Is it possible to do the same but without registering a new model?

Thanks,
3 REPLIES 3

Kaniz_Fatma
Community Manager
Community Manager

Hi @pablobd, The mlflow.models.utils.add_libraries_to_model function is used to re-log a model along with all the.... This function is typically used when you want to package your custom libraries alongside the model i....

 

However, this function requires a registered model URI (e.gmodels:/<model_name>/<model_version>) as ...

 

This means that the model needs to be registered in the Model Registry before you can use this function.

 

If you want to add libraries to a model without registering it, you might need to manually package the model along with its dependencies. This could involve saving the model and its dependencies to a file, and then loading them when you want to use the model. Please note that this approach would not leverage the MLflow Model Registry and its versioning capabilities.

pablobd
Contributor II

Thanks @Kaniz_Fatma - that's exactly how I am using it, following this: https://docs.databricks.com/en/machine-learning/model-serving/private-libraries-model-serving.html

What I don't like is that in step 2 the model is registered then in step 3, the same model (with the compiled package is registered again). So, I endup with two copies of the same model.

pablobd
Contributor II

I ended up publishing the library to AWS CodeArtifact repository. Now, how can I tell MLFlow to use AWS CodeArtifact private repository instead of PyPi?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group