Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,22 +6,8 @@ import gradio as gr
|
|
6 |
import json
|
7 |
from fastapi import FastAPI
|
8 |
from fastapi.responses import JSONResponse
|
9 |
-
|
10 |
-
|
11 |
-
# Your Gradio components here
|
12 |
-
|
13 |
-
@demo.load_fn
|
14 |
-
def setup_routes():
|
15 |
-
app = demo.app
|
16 |
-
|
17 |
-
@app.get("/health")
|
18 |
-
def health_check():
|
19 |
-
return JSONResponse(
|
20 |
-
content={"status": "healthy"},
|
21 |
-
status_code=200
|
22 |
-
)
|
23 |
-
|
24 |
-
demo.launch()
|
25 |
|
26 |
# Load and clean CSV
|
27 |
def clean_df(df):
|
@@ -157,4 +143,6 @@ iface = gr.Interface(
|
|
157 |
)
|
158 |
|
159 |
if __name__ == "__main__":
|
160 |
-
iface.launch()
|
|
|
|
|
|
6 |
import json
|
7 |
from fastapi import FastAPI
|
8 |
from fastapi.responses import JSONResponse
|
9 |
+
from your_module import app
|
10 |
+
# This is needed for Hugging Face Spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
# Load and clean CSV
|
13 |
def clean_df(df):
|
|
|
143 |
)
|
144 |
|
145 |
if __name__ == "__main__":
|
146 |
+
iface.launch()
|
147 |
+
import uvicorn
|
148 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|