Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from train import train_model | |
| from predict import predict | |
| from validate import validate_input | |
| from test import test_api | |
| from pydantic import BaseModel | |
| from validate import TransactionData # Shared schema | |
| app = FastAPI() | |
| def root(): | |
| return {"message": "LogReg FastAPI is up"} | |
| # Expose APIs | |
| app.add_api_route("/train", train_model, methods=["POST"]) | |
| app.add_api_route("/predict", predict, methods=["POST"]) | |
| app.add_api_route("/validate", validate_input, methods=["POST"]) | |
| app.add_api_route("/test", test_api, methods=["GET"]) | |