Spaces:
Runtime error
Runtime error
Update main.py
Browse files7 unmodified lines89101112131415161718192021222324252627282930313233347 unmodified linesapp = FastAPI()origins = [ "https://huggingface.co", "https://*.huggingface.co",]app.add_middleware(CORSMiddleware,allow_origins=origins,allow_credentials=True,allow_methods=["*"],allow_headers=["*"],)model = joblib.load("gradient_boosting.joblib")@app.post("/")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}7 unmodified lines89101112131415161718192021227 unmodified linesapp = 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}
main.py+6-18