Spaces:
Sleeping
Sleeping
Download app.py from jaothan/GenAI_project: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/spaces/jaothan/GenAI_project/resolve/main/app.py
- Command line
-
hf download hf://spaces/jaothan/GenAI_project/app.py
-
curl -L -o app.py https://huggingface.co/spaces/jaothan/GenAI_project/resolve/main/app.py
442 Bytes
| from flask import Flask, jsonify, request | |
| import mlflow.pyfunc | |
| app = Flask(__name__) | |
| # Load the model as a PyFuncModel. | |
| model = mlflow.pyfunc.load_model(model_uri="models:/deployed_model/1") | |
| def predict(): | |
| data = request.get_json() | |
| predictions = model.predict(data) | |
| return jsonify(predictions.tolist()) | |
| if __name__ == '__main__': | |
| app.run(host='0.0.0.0', port=5000) | |