Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -835,7 +835,7 @@ async def test_endpoint():
|
|
| 835 |
"timestamp": datetime.now().isoformat()
|
| 836 |
}
|
| 837 |
|
| 838 |
-
# For Hugging Face Spaces deployment -
|
| 839 |
def get_app():
|
| 840 |
return app
|
| 841 |
|
|
@@ -852,9 +852,8 @@ if __name__ == "__main__":
|
|
| 852 |
print("๐จ Web interface available at: /ui")
|
| 853 |
print("๐ Both API and UI running on same port")
|
| 854 |
|
| 855 |
-
#
|
| 856 |
-
|
| 857 |
-
app = gr.mount_gradio_app(app, gradio_app, path="/ui")
|
| 858 |
|
| 859 |
# Run the combined app
|
| 860 |
uvicorn.run(
|
|
@@ -904,5 +903,4 @@ if __name__ == "__main__":
|
|
| 904 |
while True:
|
| 905 |
time.sleep(1)
|
| 906 |
except KeyboardInterrupt:
|
| 907 |
-
print("๐ Shutting down servers...")
|
| 908 |
-
|
|
|
|
| 835 |
"timestamp": datetime.now().isoformat()
|
| 836 |
}
|
| 837 |
|
| 838 |
+
# For Hugging Face Spaces deployment - FIXED APPROACH
|
| 839 |
def get_app():
|
| 840 |
return app
|
| 841 |
|
|
|
|
| 852 |
print("๐จ Web interface available at: /ui")
|
| 853 |
print("๐ Both API and UI running on same port")
|
| 854 |
|
| 855 |
+
# FIX: Properly mount Gradio without reassigning app
|
| 856 |
+
gr.mount_gradio_app(app, gradio_app, path="/ui")
|
|
|
|
| 857 |
|
| 858 |
# Run the combined app
|
| 859 |
uvicorn.run(
|
|
|
|
| 903 |
while True:
|
| 904 |
time.sleep(1)
|
| 905 |
except KeyboardInterrupt:
|
| 906 |
+
print("๐ Shutting down servers...")
|
|
|