Spaces:
Sleeping
Sleeping
Commit ·
decfb00
1
Parent(s): 7655952
commit 00000012
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ from fastapi import FastAPI
|
|
| 13 |
from starlette.middleware.wsgi import WSGIMiddleware
|
| 14 |
from gradio.routes import mount_gradio_app
|
| 15 |
|
| 16 |
-
|
| 17 |
# ✅ Safe GPU decorator
|
| 18 |
try:
|
| 19 |
from spaces import GPU
|
|
@@ -188,8 +187,7 @@ fastapi_app = FastAPI()
|
|
| 188 |
fastapi_app.mount("/", WSGIMiddleware(flask_app))
|
| 189 |
|
| 190 |
# Mount Gradio at root path (overrides Flask's "/")
|
| 191 |
-
app = mount_gradio_app(fastapi_app, demo, path="/
|
| 192 |
# Gradio runs on port 7860 in HF Spaces
|
| 193 |
if __name__ == "__main__":
|
| 194 |
-
|
| 195 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 13 |
from starlette.middleware.wsgi import WSGIMiddleware
|
| 14 |
from gradio.routes import mount_gradio_app
|
| 15 |
|
|
|
|
| 16 |
# ✅ Safe GPU decorator
|
| 17 |
try:
|
| 18 |
from spaces import GPU
|
|
|
|
| 187 |
fastapi_app.mount("/", WSGIMiddleware(flask_app))
|
| 188 |
|
| 189 |
# Mount Gradio at root path (overrides Flask's "/")
|
| 190 |
+
app = mount_gradio_app(fastapi_app, demo, path="/") # Mount Flask under /flask
|
| 191 |
# Gradio runs on port 7860 in HF Spaces
|
| 192 |
if __name__ == "__main__":
|
| 193 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|