ShrirajSK's picture
Update main.py
3da1749
raw
history blame contribute delete
645 Bytes
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}