On my local machine, I have tuned and logged the hyperparams for a ML-model and created a public GitHub Repo with the mlruns folder.
Because I also want to use the model in a Google Collab environment, I am trying to figure out how to load that model from my public GitHub repo.
Locally, with
# Import and training of the best-tuned model from the MLflow registry
model_name = "model-XYZ"
model_version = 1
model = mlflow.sklearn.load_model(f"models:/{model_name}/{model_version}")
_ = model.fit(X_train, y_train)
that's not a problem. However with GitHub, I don't know how the path should look like? Previous tries e.g. with
github_repo = "myRepo"
run_id = "myrunID"
model_name = "myModelName"
model_uri = f"https://raw.githubusercontent.com/{github_repo}/blob/main/mlruns/0/{run_id}/artifacts/{model_name}"
model = mlflow.sklearn.load_model(model_uri)
did not work.
EDIT: Now I helped myself by simply cloning the whole repo into my google collaboration and navigating into the root directory just as in my local project. However, now it doesn't recognize (not found) the model name I am trying to provide it with, even though the folder definitely is there and also works locally.