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

chore: downgrade to Gradio 4.x for compatibility

Browse files

- Lock gradio to >=4.0,<5.0 in requirements.txt
- Revert theme/css to gr.Blocks() constructor (4.x style)
- Restore type='messages' in gr.Chatbot (4.x style)
- Update README sdk_version to 4.43.0

Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +6 -5
  3. requirements.txt +1 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 📖
4
  colorFrom: red
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 5.23.0
8
  app_file: app.py
9
  python_version: "3.10"
10
  pinned: false
 
4
  colorFrom: red
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.43.0
8
  app_file: app.py
9
  python_version: "3.10"
10
  pinned: false
app.py CHANGED
@@ -1758,6 +1758,11 @@ def build_app() -> gr.Blocks:
1758
 
1759
  with gr.Blocks(
1760
  title="StoryWeaver - 交互式叙事系统",
 
 
 
 
 
1761
  ) as app:
1762
 
1763
  gr.Markdown(
@@ -1802,6 +1807,7 @@ def build_app() -> gr.Blocks:
1802
  chatbot = gr.Chatbot(
1803
  label="故事",
1804
  height=480,
 
1805
  )
1806
 
1807
  location_map_panel = gr.Markdown(
@@ -1997,9 +2003,4 @@ if __name__ == "__main__":
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
  )
 
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
  chatbot = gr.Chatbot(
1808
  label="故事",
1809
  height=480,
1810
+ type="messages",
1811
  )
1812
 
1813
  location_map_panel = gr.Markdown(
 
2003
  share=False,
2004
  show_error=True,
2005
  allowed_paths=[str(IMAGE_DIR)],
 
 
 
 
 
2006
  )
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  openai>=1.0.0
2
- gradio>=4.0.0
3
  python-dotenv>=1.0.0
4
  pydantic>=2.0.0
 
1
  openai>=1.0.0
2
+ gradio>=4.0,<5.0
3
  python-dotenv>=1.0.0
4
  pydantic>=2.0.0