mou3az commited on
Commit
50eebb5
1 Parent(s): 3a15aaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- index = error_message.find("Input validation error:")
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: