Rick commited on
Commit
4ea7e36
·
verified ·
1 Parent(s): e4280da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -20
app.py CHANGED
@@ -1,24 +1,4 @@
1
- from fastapi import FastAPI
2
- from gradio.routes import mount_gradio_app
3
 
4
- # Create a FastAPI instance
5
- app = FastAPI()
6
-
7
- # Mount Gradio demo inside FastAPI
8
- mount_gradio_app(app, demo, path="/")
9
-
10
- # Add your API endpoint
11
- @app.post("/api/predict")
12
- async def api_predict(area: str, item: str, year: int, rainfall: float, pesticides: float, temperature: float):
13
- result, input_table, interpretation, interpretation_class, debug_info = predict_yield(
14
- area, item, year, rainfall, pesticides, temperature
15
- )
16
- return {
17
- "predicted_yield": result,
18
- "interpretation": interpretation,
19
- "class": interpretation_class,
20
- "debug": debug_info
21
- }
22
 
23
 
24
 
 
 
 
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
 
4