WorkTimer commited on
Commit
937fcbb
Β·
verified Β·
1 Parent(s): cd922ef

Move theme to launch(), disable SSR to silence asyncio noise

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -189,7 +189,7 @@ def run_inference(
189
  # ── UI ─────────────────────────────────────────────────────────────────────────
190
 
191
  def build_ui():
192
- with gr.Blocks(title="PanCancerSeg Inference", theme=gr.themes.Soft()) as demo:
193
  gr.Markdown(
194
  """
195
  # PanCancerSeg β€” Specialist CT Tumour Segmentation
@@ -266,4 +266,10 @@ if __name__ == "__main__":
266
  # Hugging Face Spaces expect the app on port 7860 (set via GRADIO_SERVER_PORT).
267
  # Locally this falls back to 7860 unless overridden.
268
  port = int(os.environ.get("GRADIO_SERVER_PORT", 7860))
269
- demo.launch(server_name="0.0.0.0", server_port=port, share=False)
 
 
 
 
 
 
 
189
  # ── UI ─────────────────────────────────────────────────────────────────────────
190
 
191
  def build_ui():
192
+ with gr.Blocks(title="PanCancerSeg Inference") as demo:
193
  gr.Markdown(
194
  """
195
  # PanCancerSeg β€” Specialist CT Tumour Segmentation
 
266
  # Hugging Face Spaces expect the app on port 7860 (set via GRADIO_SERVER_PORT).
267
  # Locally this falls back to 7860 unless overridden.
268
  port = int(os.environ.get("GRADIO_SERVER_PORT", 7860))
269
+ demo.launch(
270
+ server_name="0.0.0.0",
271
+ server_port=port,
272
+ share=False,
273
+ theme=gr.themes.Soft(),
274
+ ssr_mode=False,
275
+ )