Yokky009 commited on
Commit
9b1b384
·
verified ·
1 Parent(s): a8b07c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -112,7 +112,8 @@ def respond(
112
  return full_response #追加
113
 
114
  except Exception as e:
115
- yield f"エラーが発生しました: {str(e)}"
 
116
 
117
  """
118
  Gradio ChatInterfaceを使用したシンプルなチャットボット
@@ -158,6 +159,7 @@ demo = gr.ChatInterface(
158
  ["プログラミングについて質問があります。"],
159
  ],
160
  cache_examples=False,
 
161
  )
162
 
163
  if __name__ == "__main__":
 
112
  return full_response #追加
113
 
114
  except Exception as e:
115
+ #yield f"エラーが発生しました: {str(e)}"
116
+ return f"エラーが発生しました: {str(e)}" #追加
117
 
118
  """
119
  Gradio ChatInterfaceを使用したシンプルなチャットボット
 
159
  ["プログラミングについて質問があります。"],
160
  ],
161
  cache_examples=False,
162
+ streaming=False # 追加 ← これで return のみ受け付ける同期モードに
163
  )
164
 
165
  if __name__ == "__main__":