Spaces:
Sleeping
Sleeping
Download app.py from ShadowTEM/Heart_attack: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/spaces/ShadowTEM/Heart_attack/resolve/main/app.py
- Command line
-
hf download hf://spaces/ShadowTEM/Heart_attack/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ShadowTEM/Heart_attack/resolve/main/app.py
744 Bytes
| from flask import Flask, render_template, request | |
| from deployment.controller.GetPredictions import GetPredictions | |
| from deployment.controller.LoadModel import LoadModel | |
| app = Flask(__name__,template_folder='deployment/templates') | |
| model = LoadModel('deployment/models/heart_attack_detection_model_99.3%.pkl') | |
| def home(): | |
| print("Rendering home page...") # Debug log | |
| return render_template('home.html') | |
| def predict(): | |
| if request.method == 'POST': | |
| inputs = request.form.to_dict() | |
| prediction = GetPredictions(model, inputs) | |
| return render_template('result.html', prediction=prediction) | |
| if __name__ == '__main__': | |
| app.run(host="0.0.0.0", port=7860) |