I've stored my model in Github with MLProject so that others may run it in various variations. Now I would like to log the models created by runs as artifacts so that users can load them with MLModel. As my model is custom this is not as simple as with flavors such as spark. I first saved and loaded the model locally to make sure my Environment, model and artifact Code works. Now I want to include the Login of the model as part of the MLProject run from GitHub. As there is no example in the documentation I know of, I wanted to ask for help and suggest that this may be a good addition to the documentation or examples.
In Terms of Code I wrote the follwing inside the mlrun at the end:
Model depending on the Parameters specified in the Project run
ETS_Exogen = ETS_Exogen(params=res.x, before=before,after=after)
logging the model with the previously defined model, evironment and artifacts
mlflow.pyfunc.log_model(python_model=ETS_Exogen, conda_env=conda_env,artifacts=artifacts)
Does mlflow.pyfunc.log_model automatically log the model into the artifacts of the runs or do I Need to define an artifact_path? Should I rather use mlflow.pyfunc.save_model ? I defined the artifacts paths so that they would be gathered from the GitHub repository as follows:
artifacts = { "exogen_variables":os.path.join(os.path.dirname(os.path.abspath(file)),"exogen_variables.csv") }
Is this correct? Links to Documentation on custom Models: https://mlflow.org/docs/latest/python_api/mlflow.pyfunc.html#pyfunc-create-custom-workflows