Download app.py from TanyaVM/2: direct link, hf CLI and curl.
- Browser
- Download file 497 Bytes
-
https://huggingface.co/spaces/TanyaVM/2/resolve/main/app.py
- Command line
-
hf download hf://spaces/TanyaVM/2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/TanyaVM/2/resolve/main/app.py
497 Bytes
| from flask import Flask, request, jsonify | |
| app = Flask(__name__) | |
| def predict(): | |
| # Get JSON input from the request | |
| # data = request.get_json() | |
| # text = data.get("text", "") | |
| text = request.data | |
| # Perform some dummy prediction (replace with model logic) | |
| prediction = f"Processed text: {text}" | |
| # Return the result | |
| return jsonify({"prediction": prediction}) | |
| if __name__ == '__main__': | |
| app.run(host='0.0.0.0', port=7860) | |