Spaces:
Runtime error
Runtime error
File size: 645 Bytes
6fc8472 0f0168e 6fc8472 3da1749 c900d71 6fc8472 3da1749 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from fastapi import FastAPI, Response, status, File, Form, UploadFile
from pydantic import BaseModel
import joblib
from fastapi.middleware.cors import CORSMiddleware
class Airflow(BaseModel):
topic: str
app = FastAPI()
model = joblib.load("gradient_boosting.joblib")
@app.get("/")
def read_root():
return {"Hello": "World!"}
# @app.post("/api/volume_prediction")
# async def predict_volume(vol_moving_avg: float = Form(...), adj_close_rolling_med: float = Form(...)):
# features = [vol_moving_avg, adj_close_rolling_med]
# predicted_volume = model.predict([features])[0]
# return {"predicted_volume": predicted_volume}
|