Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing a specific model version is not preserving the model versions #183

Open
paravatha opened this issue Jun 6, 2024 · 1 comment

Comments

@paravatha
Copy link

paravatha commented Jun 6, 2024

while trying to export and import a specific model (version 2), the model version is being imported as (version 1)
version.json
image

Code to import

        model_name = model_metadata["model_name"]
        import_model_version(
            model_name=model_name,
            experiment_name=model_metadata["experiment_name"],
            create_model=True,
            import_source_tags=True,
            import_metadata=True,
            import_stages_and_aliases=True,
            input_dir=f"{input_dir_prefix}/{model_name}",
        )

I believe this code snippet is creating a model with version 1

    # NOTE: MLflow UC bug:
    # The client's tracking_uri is not honored. Instead MlflowClient.create_model_version()
    # seems to use mlflow.tracking_uri internally to download run artifacts for UC models.
    with MlflowTrackingUriTweak(mlflow_client):
        dst_vr = mlflow_client.create_model_version(
            name = model_name,
            source = dst_source,
            run_id = dst_run_id,
            description = src_vr.get("description"),
            tags = tags
        )
@paravatha
Copy link
Author

@amesar referring to this comment #50 (comment)
Is this still the case? I am wondering if there a way around to preserve model version number as we export and import model versions

However, if the source server has model versions 1,2,3 and 4, and you export 2 and 4, your imported destination versions will be 1 and 2.

@paravatha paravatha changed the title importing a specific model version is not working importing a specific model version is not preserving the model versions Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant