TurkishCodeMan commited on
Commit
468b189
·
verified ·
1 Parent(s): cd968a4

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. requirements.txt +3 -2
app.py CHANGED
@@ -77,10 +77,9 @@ def respond(query: str, history: list):
77
  if chart_data:
78
  chart_image = create_chart(chart_data)
79
 
80
- # Update history (Gradio 6.x messages format)
81
  history = history or []
82
- history.append({"role": "user", "content": query})
83
- history.append({"role": "assistant", "content": response})
84
 
85
  return history, chart_image
86
 
 
77
  if chart_data:
78
  chart_image = create_chart(chart_data)
79
 
80
+ # Update history (Gradio 4.x tuple format)
81
  history = history or []
82
+ history.append((query, response))
 
83
 
84
  return history, chart_image
85
 
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
- gradio>=5.0.0
2
- huggingface-hub>=0.25.0
3
  matplotlib>=3.8.0
4
  numpy>=1.24.0
5
  Pillow>=10.0.0
 
 
1
+ gradio>=4.44.0,<5.0.0
2
+ huggingface-hub==0.23.0
3
  matplotlib>=3.8.0
4
  numpy>=1.24.0
5
  Pillow>=10.0.0
6
+ pydantic>=2.0.0