boskicl
New Contributor III
from pyspark.ml import PipelineModel

mlflow.set_registry_uri("databricks-uc")

local_model_path = "/local_disk0/mlflow_model"
volume_path = f"/Volumes/{catalogue}/default/mlflow_tmp/sparkml"

# Works fine - downloads to driver
mlflow.artifacts.download_artifacts(
    artifact_uri=f"models:/{model_name}@production",
    dst_path=local_model_path
)

# Copy from driver local disk to UC Volume (shared across all nodes)
dbutils.fs.cp(
    f"file://{local_model_path}/sparkml",
    f"dbfs:{volume_path}",
    recurse=True
)

# Load from UC Volume — all workers can reach this
model = PipelineModel.load(volume_path)


Tried this workaround just now but is there a proper way to read the Regressor type model?

View solution in original post