azureml-examples
azureml-examples copied to clipboard
Update Python to version 3.8+ (#2273)
-
Update python version to 3.8+
-
Ran cli/readme.py and sdk/python/readme.py
Description
Checklist
- [x] I have read the contribution guidelines
- [x] Pull request includes test coverage for the included changes.
@santiagxf can you help checking this? @vs-li alternatively, could you clone this branch and test locally? #assign-reviewer: @santiagxf
Exception:
raise MlflowException(
mlflow.exceptions.MlflowException: The input must be a JSON dictionary with exactly one of the input fields {'dataframe_records', 'dataframe_split', 'inputs', 'instances'}. Received dictionary with input fields: ['columns', 'data', 'index']. IMPORTANT: The MLflow Model scoring protocol has changed in MLflow version 2.0. If you are seeing this error, you are likely using an outdated scoring request format. To resolve the error, either update your request format or adjust your MLflow Model's requirements file to specify an older version of MLflow (for example, change the 'mlflow' requirement specifier to 'mlflow==1.30.0'). If you are making a request using the MLflow client (e.g. via `mlflow.pyfunc.spark_udf()`), upgrade your MLflow client to a version >= 2.0 in order to use the new request format. For more information about the updated MLflow Model scoring protocol in MLflow 2.0, see https://mlflow.org/docs/latest/models.html#deploy-mlflow-models.
Outdated JSON file that the notebook is referencing: https://github.com/Azure/azureml-examples/blob/vivianli/update-python-version/sdk/python/endpoints/online/mlflow/sample-request-sklearn.json#L0-L1
Does anyone know who to contact to update this JSON? Pinging @balapv as they are the most recent contributor to the JSON file.
Update from @snowei: Wait to see if previous model and new sklearn version works well together. If yes, then no need to change. If no, then try to regenerate model by the following:
import dill
from sklearn.datasets import load_diabetes
from sklearn.linear_model import Ridge
dataset_x, dataset_y = load_diabetes(return_X_y=True)
model = Ridge().fit(dataset_x, dataset_y)
dill.dump(model, open('sklearn_regression_model.pkl', 'wb'))
Currently also talking to Facundo about sklearn sample request JSON file.