HomesteaderLabs commited on
Commit
629e356
·
verified ·
1 Parent(s): 5955a7b

Revert theme/css to launch() (Gradio 6 location); keep ssr_mode=False

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -280,7 +280,7 @@ button.eink-scan:hover { background:var(--copper) !important; border-color:var(-
280
  #notice * { font-size:.74rem !important; color:var(--ink2) !important; }
281
  """
282
 
283
- with gr.Blocks(title="Forager's Field Station", theme=gr.themes.Monochrome(), css=CSS) as demo:
284
  gr.HTML(
285
  "<div id='masthead'>"
286
  " <div class='brand'>HOMESTEADER LABS</div>"
@@ -312,7 +312,7 @@ with gr.Blocks(title="Forager's Field Station", theme=gr.themes.Monochrome(), cs
312
  img.change(identify, inputs=img, outputs=out)
313
 
314
  if __name__ == "__main__":
315
- # ssr_mode=False: this app doesn't need server-side rendering, and Gradio 6's
316
- # Node SSR proxy fails to bind port 7860 on HF Spaces (no Node runtime), which
317
- # leaves the app stranded on :7861 where HF can't reach it.
318
- demo.launch(ssr_mode=False)
 
280
  #notice * { font-size:.74rem !important; color:var(--ink2) !important; }
281
  """
282
 
283
+ with gr.Blocks(title="Forager's Field Station") as demo:
284
  gr.HTML(
285
  "<div id='masthead'>"
286
  " <div class='brand'>HOMESTEADER LABS</div>"
 
312
  img.change(identify, inputs=img, outputs=out)
313
 
314
  if __name__ == "__main__":
315
+ # theme/css belong in launch() in Gradio 6. ssr_mode=False is also enforced via
316
+ # the GRADIO_SSR_MODE Space variable Gradio 6's Node SSR proxy can't bind port
317
+ # 7860 on this Space, which otherwise strands the app on :7861 (unreachable).
318
+ demo.launch(theme=gr.themes.Monochrome(), css=CSS, ssr_mode=False)