Spaces:
Runtime error
Runtime error
added error handling
Browse files
app.py
CHANGED
|
@@ -168,8 +168,12 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
| 168 |
# client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 169 |
|
| 170 |
def predict(message, history, min_hist_memo = 3):
|
| 171 |
-
|
| 172 |
-
streamer
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
yield str(streamer)
|
| 174 |
|
| 175 |
gr.ChatInterface(predict, title="Mistral 7B").queue().launch(debug=True)
|
|
|
|
| 168 |
# client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 169 |
|
| 170 |
def predict(message, history, min_hist_memo = 3):
|
| 171 |
+
streamer = None
|
| 172 |
+
while streamer == None:
|
| 173 |
+
try:
|
| 174 |
+
streamer = chain.invoke({"name":message, "format_instructions":format_instructions})
|
| 175 |
+
except:
|
| 176 |
+
pass
|
| 177 |
yield str(streamer)
|
| 178 |
|
| 179 |
gr.ChatInterface(predict, title="Mistral 7B").queue().launch(debug=True)
|