Spaces:
No application file
No application file
Download app.py from tejaredddy/studentspace: direct link, hf CLI and curl.
- Browser
- Download file 600 Bytes
-
https://huggingface.co/spaces/tejaredddy/studentspace/resolve/main/app.py
- Command line
-
hf download hf://spaces/tejaredddy/studentspace/app.py
-
curl -L -o app.py https://huggingface.co/spaces/tejaredddy/studentspace/resolve/main/app.py
600 Bytes
| from flask import Flask, request, jsonify, send_from_directory | |
| from flask_cors import CORS | |
| from model import predict_exam_score | |
| import os | |
| app = Flask(__name__, static_folder="../frontend") | |
| CORS(app) | |
| # Serve frontend | |
| def serve_frontend(): | |
| return send_from_directory(app.static_folder, "index.html") | |
| # Prediction API | |
| def predict(): | |
| data = request.get_json() | |
| prediction = predict_exam_score(data) | |
| return jsonify({"predicted_score": round(prediction, 2)}) | |
| if __name__ == "__main__": | |
| app.run(debug=True) |