A MLflow plugin that allows users to use Baidu BCE BOS(CN/EN) as the artifact store for MLflow.
pip install mlflow-baidubce-store-plugin -U
import mlflow.pyfunc
import os
os.environ["MLFLOW_BOS_ENDPOINT"] = "bj.bcebos.com"
os.environ["MLFLOW_BOS_SECRET_ACCESS_KEY"] = "AK"
os.environ["MLFLOW_BOS_KEY_ID"] = "SK"
class Mod(mlflow.pyfunc.PythonModel):
def predict(self, ctx, inp):
return 8765
exp_name = "bos-exp"
mlflow.create_experiment(exp_name, artifact_location="bos://mlflow-test/")
mlflow.set_experiment(exp_name)
mlflow.pyfunc.log_model('model_test', python_model=Mod())
print(mlflow.get_artifact_uri())
mlflow.artifacts.download_artifacts(mlflow.get_artifact_uri())