encryptd commited on
Commit
29918ac
·
1 Parent(s): d2f3bbf

prog update

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +4 -6
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 5.42.0
8
  app_file: app.py
9
  pinned: false
10
  hf_oauth: true
 
4
  colorFrom: yellow
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.44.1
8
  app_file: app.py
9
  pinned: false
10
  hf_oauth: true
app.py CHANGED
@@ -116,12 +116,10 @@ with gr.Blocks(title="NuMarkdown API Server") as demo:
116
 
117
  # --- STEP 4: SAFE MOUNTING ---
118
  # We mount Gradio to a subpath to prevent it from fighting with the Root path and breaking CSS/JS.
119
- app = gr.mount_gradio_app(app, demo, path="/ui")
120
-
121
- # Redirect anyone visiting the root URL to the UI.
122
- @app.get("/")
123
- def redirect_to_ui():
124
- return RedirectResponse(url="/ui")
125
 
126
  if __name__ == "__main__":
127
  uvicorn.run(app, host="0.0.0.0", port=HF_PORT, workers=1)
 
116
 
117
  # --- STEP 4: SAFE MOUNTING ---
118
  # We mount Gradio to a subpath to prevent it from fighting with the Root path and breaking CSS/JS.
119
+ # Start Gradio's internal state
120
+ demo.queue()
121
+ # This creates the FastAPI instance Gradio uses
122
+ app = demo.app
 
 
123
 
124
  if __name__ == "__main__":
125
  uvicorn.run(app, host="0.0.0.0", port=HF_PORT, workers=1)