multimodalart HF Staff commited on
Commit
4c8af88
·
verified ·
1 Parent(s): d154283

Move theme and css to launch() — Gradio 6 ignores them on Blocks

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -214,7 +214,9 @@ CSS = """
214
  .dark .gradio-container { color: var(--body-text-color); }
215
  """
216
 
217
- with gr.Blocks(theme=gr.themes.Citrus(), css=CSS, title="Sprite Forge") as demo:
 
 
218
  with gr.Column(elem_id="col-container"):
219
  gr.Markdown(
220
  """
@@ -300,4 +302,10 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS, title="Sprite Forge") as demo:
300
  )
301
 
302
  if __name__ == "__main__":
303
- demo.queue(default_concurrency_limit=4).launch(ssr_mode=False, show_error=True, allowed_paths=[OUTPUT_DIR])
 
 
 
 
 
 
 
214
  .dark .gradio-container { color: var(--body-text-color); }
215
  """
216
 
217
+ # Gradio 6 moved `theme` and `css` off the Blocks constructor onto `launch()`; passing them here is only a warning,
218
+ # so the theme silently does not apply.
219
+ with gr.Blocks(title="Sprite Forge") as demo:
220
  with gr.Column(elem_id="col-container"):
221
  gr.Markdown(
222
  """
 
302
  )
303
 
304
  if __name__ == "__main__":
305
+ demo.queue(default_concurrency_limit=4).launch(
306
+ theme=gr.themes.Citrus(),
307
+ css=CSS,
308
+ ssr_mode=False,
309
+ show_error=True,
310
+ allowed_paths=[OUTPUT_DIR],
311
+ )