Fix undefined model_info variable in quickstart documentation#18671
Merged
Fix undefined model_info variable in quickstart documentation#18671
Conversation
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix documentation for loading model in MLFlow
Fix undefined model_info variable in quickstart documentation
Nov 5, 2025
Member
|
@copilot Thanks for the update!
|
Contributor
Author
I've verified all 8 .mdx files that use ✅ All files now have proper
Every usage of |
Contributor
|
@Copilot Thank you for the contribution! Could you fix the following issue(s)? ⚠ Invalid PR templateThis PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out. |
Contributor
|
Documentation preview for 3d34ee1 is available at: Changed Pages (2)More info
|
harupy
approved these changes
Nov 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #18670
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Step 6 of the quickstart documentation uses
model_info.model_urito load a logged model, but Step 5 never captures the return value fromlog_model(), causing aNameErrorwhen users follow the tutorial.Changes
Updated Step 5 in both quickstart guides to capture the
ModelInfoobject:Files Modified
docs/docs/classic-ml/tracking/quickstart/index.mdxdocs/docs/classic-ml/getting-started/quickstart.mdxThis allows Step 6 to reference
model_info.model_urias intended.Original prompt
This section details on the original issue you should resolve
<issue_title>[DOC-FIX] Python code given in Step 6 - Load the model back for inference. fails</issue_title>
<issue_description>### Willingness to contribute
Yes. I can contribute a documentation fix independently.
URL(s) with the issue
Direct URL : https://mlflow.org/docs/latest/ml/tracking/quickstart/#step-6---load-the-model-back-for-inference
Description of proposal (what needs changing)
Python version : 3.13.0b3
MLFlow version : 3.5.1
Jupyter Notebook version : 7.4.7
Going through the MLFlow Tracking Quickstart page, I found that the Python code given at the end of the page under Step 6 does not execute. It has a error in the first line itself :
loaded_model = mlflow.pyfunc.load_model(model_info.model_uri)The model_info variable isn't declared anywhere in the code snippets given on the page. The error is :
After some investigations, I figured out that at least two arguments should be supplied to mlflow.pyfunc.load_model which are the model URI and the name of the model. I thus modified the first line as follows :
loaded_model = mlflow.pyfunc.load_model("mlflow-artifacts:/916644062995257796/models/m-8cfa42826fdc479eb2512155cc91a54a/artifacts/MLmodel","iris_model")The URI is the same as the MLModel URI on my local MLFlow server and the model's name is iris_model.
I also had to make a folder with the model name in my local Jupyter notebook directory. Now the error I am getting is :