QuestionQ138

VerifiedAdvanced MLflow Usage

A Data Scientist trained a sentiment-analysis model with Hugging Face Transformers. They wrap the model in a custom PyFunc to standardize prediction behavior across various inference platforms. The model contains a preprocessing script and a label encoder, both saved alongside the model. They want to register the model in Unity Catalog and ensure that all artifacts are tracked and reproducible.

Which action should they take?

Explanation

mlflow.pyfunc.log_model() packages custom PythonModel inference logic and its declared artifact dependencies into an MLflow model. The artifacts parameter makes the preprocessing script and label encoder part of the tracked, reproducible model package; they can be accessed through the PyFunc model context when loaded. Registering that logged model with the Unity Catalog-backed MLflow Model Registry creates a governed, versioned registered model.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!