This message was deleted.
# ask-for-help
s
This message was deleted.
c
Hi @이호민 - could you share your code how you get the path?
It differs slightly depending how your MLFlow registry is set up
In general it supports one of the following formats:
Copy code
/Users/me/path/to/local/model
../relative/path/to/local/model
<s3://my_bucket/path/to/model>
runs:/<mlflow_run_id>/run-relative/path/to/model
models:/<model_name>/<model_version>
models:/<model_name>/<stage>
See https://docs.bentoml.com/en/latest/integrations/mlflow.html#import-an-mlflow-model
u
Thank you for the comments. I am attempting to save and manage checkpoint files in
mlflow
artifact
as a callback of
pytorch lighting
. Below is the code I’m using.
Copy code
# get artifact path
mlflow_artifact_uri = mlflow.get_artifact_uri()
# import model to bentoml
bentoml.mlflow.import_model(
        "mlflow_project_classification",
        mlflow_artifact_uri,
        signatures={"predict": {"batchable": True}},
    )
Thank you for your help even though it’s the weekend.
c
could you try print what’s the output of
mlflow.get_artifact_uri
?
u
That value is
file:///some/thing/classification_trainer/mlruns/0/5b864c88bec740eab980fae71015a291/artifacts
that directory tree is
Copy code
├── model
│   ├── MLmodel
│   ├── conda.yaml
│   ├── data
│   │   ├── model.pth
│   │   └── pickle_module_info.txt
│   ├── python_env.yaml
│   └── requirements.txt
└── model_summary.txt
c
The path should contain a MLmodel file, I guess you just need to add “/model” to the url returned
Or use mlflow.get_artifact_uri(“model”)
The “model” folder name here should be same as the artifact_path used when logging the model