Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import threading
|
|
| 8 |
import requests as http
|
| 9 |
from concurrent.futures import ThreadPoolExecutor
|
| 10 |
from pathlib import Path
|
|
|
|
| 11 |
|
| 12 |
app = FastAPI(docs_url=None, redoc_url=None)
|
| 13 |
|
|
@@ -92,4 +93,8 @@ async def fetch_data(Number: str = Query(None)):
|
|
| 92 |
|
| 93 |
@app.exception_handler(StarletteHTTPException)
|
| 94 |
async def custom_404(request: Request, exc: StarletteHTTPException):
|
| 95 |
-
return JSONResponse(status_code=exc.status_code, content=[{"status": "invalid endpoint"}])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
import requests as http
|
| 9 |
from concurrent.futures import ThreadPoolExecutor
|
| 10 |
from pathlib import Path
|
| 11 |
+
import gradio as gr
|
| 12 |
|
| 13 |
app = FastAPI(docs_url=None, redoc_url=None)
|
| 14 |
|
|
|
|
| 93 |
|
| 94 |
@app.exception_handler(StarletteHTTPException)
|
| 95 |
async def custom_404(request: Request, exc: StarletteHTTPException):
|
| 96 |
+
return JSONResponse(status_code=exc.status_code, content=[{"status": "invalid endpoint"}])
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
demo = gr.Interface(fn=lambda x: x, inputs="text", outputs="text")
|
| 100 |
+
app = gr.mount_gradio_app(app, demo, path="/ui")
|