Update app.py
Browse files
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__":
|