Download app/main.py from amos-fernandes/DeepFin: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/amos-fernandes/DeepFin/resolve/main/app/main.py
- Command line
-
hf download hf://amos-fernandes/DeepFin/app/main.py
-
curl -L -o main.py https://huggingface.co/amos-fernandes/DeepFin/resolve/main/app/main.py
648 Bytes
| from fastapi import FastAPI, HTTPException | |
| from pydantic import BaseModel | |
| from app.utils.predict import predict_quality | |
| import uvicorn | |
| app = FastAPI(title="CNN SP500 Predictor") | |
| class InputData(BaseModel): | |
| data: list # lista de listas com as features | |
| def predict(input_data: InputData): | |
| try: | |
| prediction = predict_quality(input_data.data) | |
| return {"prediction": prediction} | |
| except Exception as e: | |
| raise HTTPException(status_code=500, detail=str(e)) | |
| # Descomente se for rodar diretamente | |
| # if __name__ == "__main__": | |
| # uvicorn.run(app, host="0.0.0.0", port=8000) | |