A-baoYang commited on
Commit
5080d2f
1 Parent(s): 3539895
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -80,9 +80,14 @@ def bot(query, history, data_array, file_paths, qa_prompt_tmpl, checkbox_replace
80
  def cat_report_explanation(data_array):
81
  response = api_qa_cat_report(data_array)
82
  full_anwser = ""
83
- for character in response:
84
- full_anwser += character
85
- yield full_anwser
 
 
 
 
 
86
 
87
  def draw_cat_pain_assessment_result(user_input_image):
88
  if user_input_image:
 
80
  def cat_report_explanation(data_array):
81
  response = api_qa_cat_report(data_array)
82
  full_anwser = ""
83
+ for chunk in response.iter_content(chunk_size=32):
84
+ if chunk:
85
+ try:
86
+ _c = chunk.decode('utf-8')
87
+ except UnicodeDecodeError:
88
+ _c = " "
89
+ full_anwser += _c
90
+ yield full_anwser
91
 
92
  def draw_cat_pain_assessment_result(user_input_image):
93
  if user_input_image: