fariedalfarizi commited on
Commit
056938d
·
1 Parent(s): c5cdcf3

Fix mount_gradio_app: import gradio and correct method call

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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 and launch interface
23
  demo = create_interface()
24
 
25
- # Mount FastAPI app to Gradio
26
- app = demo.mount_gradio_app(fastapi_app, path="/")
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(