Update app.py
Browse files
app.py
CHANGED
@@ -260,8 +260,8 @@ def Internet_Search(history, messages2):
|
|
260 |
response = chat_model.invoke(messages2)
|
261 |
except Exception as e:
|
262 |
error_message = str(e)
|
263 |
-
|
264 |
-
end_index = error_message.find("\nMake sure 'text-generation' task is supported by the model.")
|
265 |
if start_index != -1 and end_index != -1:
|
266 |
raise gr.Error(error_message[start_index:end_index].strip()) from e
|
267 |
else:
|
|
|
260 |
response = chat_model.invoke(messages2)
|
261 |
except Exception as e:
|
262 |
error_message = str(e)
|
263 |
+
start_index = error_message.find("Input validation error:")
|
264 |
+
end_index = error_message.find("4096 max_new_tokens\nMake sure 'text-generation' task is supported by the model.")
|
265 |
if start_index != -1 and end_index != -1:
|
266 |
raise gr.Error(error_message[start_index:end_index].strip()) from e
|
267 |
else:
|