what would be the code for scoring.py on azure end point, for the following python function
def predict(a):
return a*a
Function saved as mlflow model >> mlflow.pyfunc.save_model(path=’./model’, python_model=predict)
Any solutions please?
My guess..?
#–scoring.py–#
def init():
global model
global input_schema
model_path = os.path.join(os.getenv(“AZUREML_MODEL_DIR”), “model”)
model = mlflow.pyfunc.load_model(model_path)
def run(raw_data):
# Parse input data as a single value
data = raw_data
# Call your Python function
predictions = model.predict(data) # Replace with your actual function
return predictions
I tried many variations of the scoring file but it fails to generate predict outputs
Abhishek Sharda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.