Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
056938d
1
Parent(s):
c5cdcf3
Fix mount_gradio_app: import gradio and correct method call
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
|
| 6 |
import os
|
| 7 |
import logging
|
|
|
|
| 8 |
|
| 9 |
# Suppress Starlette warnings
|
| 10 |
logging.getLogger("starlette").setLevel(logging.ERROR)
|
|
@@ -19,11 +20,11 @@ if __name__ == '__main__':
|
|
| 19 |
# Initialize model
|
| 20 |
initialize_model()
|
| 21 |
|
| 22 |
-
# Create
|
| 23 |
demo = create_interface()
|
| 24 |
|
| 25 |
-
# Mount FastAPI
|
| 26 |
-
app =
|
| 27 |
|
| 28 |
# Launch with specific config
|
| 29 |
demo.launch(
|
|
|
|
| 5 |
|
| 6 |
import os
|
| 7 |
import logging
|
| 8 |
+
import gradio as gr
|
| 9 |
|
| 10 |
# Suppress Starlette warnings
|
| 11 |
logging.getLogger("starlette").setLevel(logging.ERROR)
|
|
|
|
| 20 |
# Initialize model
|
| 21 |
initialize_model()
|
| 22 |
|
| 23 |
+
# Create Gradio interface
|
| 24 |
demo = create_interface()
|
| 25 |
|
| 26 |
+
# Mount Gradio to FastAPI (correct order!)
|
| 27 |
+
app = gr.mount_gradio_app(fastapi_app, demo, path="/")
|
| 28 |
|
| 29 |
# Launch with specific config
|
| 30 |
demo.launch(
|