PPP commited on
Commit
c4eaf4b
·
1 Parent(s): ad94935

fix: resolve Gradio 6.x compatibility issues

Browse files

- Remove deprecated 'type' parameter from gr.Chatbot (removed in Gradio 6.x)
- Move theme and css from gr.Blocks constructor to demo.launch() method

Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1758,11 +1758,6 @@ def build_app() -> gr.Blocks:
1758
 
1759
  with gr.Blocks(
1760
  title="StoryWeaver - 交互式叙事系统",
1761
- theme=gr.themes.Soft(
1762
- primary_hue="emerald",
1763
- secondary_hue="blue",
1764
- ),
1765
- css=APP_UI_CSS,
1766
  ) as app:
1767
 
1768
  gr.Markdown(
@@ -1807,7 +1802,6 @@ def build_app() -> gr.Blocks:
1807
  chatbot = gr.Chatbot(
1808
  label="故事",
1809
  height=480,
1810
- type="messages",
1811
  )
1812
 
1813
  location_map_panel = gr.Markdown(
@@ -2003,4 +1997,9 @@ if __name__ == "__main__":
2003
  share=False,
2004
  show_error=True,
2005
  allowed_paths=[str(IMAGE_DIR)],
 
 
 
 
 
2006
  )
 
1758
 
1759
  with gr.Blocks(
1760
  title="StoryWeaver - 交互式叙事系统",
 
 
 
 
 
1761
  ) as app:
1762
 
1763
  gr.Markdown(
 
1802
  chatbot = gr.Chatbot(
1803
  label="故事",
1804
  height=480,
 
1805
  )
1806
 
1807
  location_map_panel = gr.Markdown(
 
1997
  share=False,
1998
  show_error=True,
1999
  allowed_paths=[str(IMAGE_DIR)],
2000
+ theme=gr.themes.Soft(
2001
+ primary_hue="emerald",
2002
+ secondary_hue="blue",
2003
+ ),
2004
+ css=APP_UI_CSS,
2005
  )