Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -127,7 +127,7 @@ def retry_fun_beta(chat_history_beta ):
|
|
127 |
Retries the prediction for the last message in the chat history.
|
128 |
Removes the last interaction and gets a new prediction for the same message from Zephyr-7b-Beta
|
129 |
"""
|
130 |
-
|
131 |
raise gr.Error("Chat history is empty or invalid.")
|
132 |
|
133 |
message = chat_history_beta[-1][0]
|
@@ -141,7 +141,7 @@ def retry_fun_alpha(chat_history_alpha ):
|
|
141 |
Retries the prediction for the last message in the chat history.
|
142 |
Removes the last interaction and gets a new prediction for the same message from Zephyr-7b-Alpha
|
143 |
"""
|
144 |
-
|
145 |
raise gr.Error("Chat history is empty or invalid.")
|
146 |
|
147 |
message = chat_history_alpha[-1][0]
|
|
|
127 |
Retries the prediction for the last message in the chat history.
|
128 |
Removes the last interaction and gets a new prediction for the same message from Zephyr-7b-Beta
|
129 |
"""
|
130 |
+
if not chat_history or len(chat_history) < 1:
|
131 |
raise gr.Error("Chat history is empty or invalid.")
|
132 |
|
133 |
message = chat_history_beta[-1][0]
|
|
|
141 |
Retries the prediction for the last message in the chat history.
|
142 |
Removes the last interaction and gets a new prediction for the same message from Zephyr-7b-Alpha
|
143 |
"""
|
144 |
+
if not chat_history or len(chat_history) < 1:
|
145 |
raise gr.Error("Chat history is empty or invalid.")
|
146 |
|
147 |
message = chat_history_alpha[-1][0]
|