mou3az commited on
Commit
fa6f281
1 Parent(s): 2c13da5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -216,7 +216,7 @@ def Chat_Message(history, messages1):
216
  except Exception as e:
217
  error_message = str(e)
218
  start_index = error_message.find("Input validation error:")
219
- end_index = error_message.find("and 4096 max_new_tokens\nMake sure 'text-generation' task is supported by the model.")
220
  if start_index != -1 and end_index != -1:
221
  raise gr.Error(error_message[start_index:end_index].strip()) from e
222
  else:
@@ -261,7 +261,7 @@ def Internet_Search(history, 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("and 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:
@@ -298,7 +298,7 @@ def Chart_Generator(history, messages3):
298
  except Exception as e:
299
  error_message = str(e)
300
  start_index = error_message.find("Input validation error:")
301
- end_index = error_message.find("and 4096 max_new_tokens\nMake sure 'text-generation' task is supported by the model.")
302
  if start_index != -1 and end_index != -1:
303
  raise gr.Error(error_message[start_index:end_index].strip()) from e
304
  else:
@@ -322,7 +322,7 @@ def Chart_Generator(history, messages3):
322
  except Exception as e:
323
  error_message = str(e)
324
  start_index = error_message.find("Input validation error:")
325
- end_index = error_message.find("and 4096 max_new_tokens\nMake sure 'text-generation' task is supported by the model.")
326
  if start_index != -1 and end_index != -1:
327
  raise gr.Error(error_message[start_index:end_index].strip()) from e
328
  else:
@@ -380,7 +380,7 @@ def Link_Scratch(history, messages4):
380
  except Exception as e:
381
  error_message = str(e)
382
  start_index = error_message.find("Input validation error:")
383
- end_index = error_message.find("and 4096 max_new_tokens\nMake sure 'text-generation' task is supported by the model.")
384
  if start_index != -1 and end_index != -1:
385
  raise gr.Error(error_message[start_index:end_index].strip()) from e
386
  else:
@@ -448,7 +448,7 @@ def File_Interact(history, filepath, messages5):
448
  except Exception as e:
449
  error_message = str(e)
450
  start_index = error_message.find("Input validation error:")
451
- end_index = error_message.find("and 4096 max_new_tokens\nMake sure 'text-generation' task is supported by the model.")
452
  if start_index != -1 and end_index != -1:
453
  raise gr.Error(error_message[start_index:end_index].strip()) from e
454
  else:
 
216
  except Exception as e:
217
  error_message = str(e)
218
  start_index = error_message.find("Input validation error:")
219
+ end_index = error_message.find("\nMake sure 'text-generation' task is supported by the model.")
220
  if start_index != -1 and end_index != -1:
221
  raise gr.Error(error_message[start_index:end_index].strip()) from e
222
  else:
 
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("\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:
 
298
  except Exception as e:
299
  error_message = str(e)
300
  start_index = error_message.find("Input validation error:")
301
+ end_index = error_message.find("\nMake sure 'text-generation' task is supported by the model.")
302
  if start_index != -1 and end_index != -1:
303
  raise gr.Error(error_message[start_index:end_index].strip()) from e
304
  else:
 
322
  except Exception as e:
323
  error_message = str(e)
324
  start_index = error_message.find("Input validation error:")
325
+ end_index = error_message.find("\nMake sure 'text-generation' task is supported by the model.")
326
  if start_index != -1 and end_index != -1:
327
  raise gr.Error(error_message[start_index:end_index].strip()) from e
328
  else:
 
380
  except Exception as e:
381
  error_message = str(e)
382
  start_index = error_message.find("Input validation error:")
383
+ end_index = error_message.find("\nMake sure 'text-generation' task is supported by the model.")
384
  if start_index != -1 and end_index != -1:
385
  raise gr.Error(error_message[start_index:end_index].strip()) from e
386
  else:
 
448
  except Exception as e:
449
  error_message = str(e)
450
  start_index = error_message.find("Input validation error:")
451
+ end_index = error_message.find("and 4096 max_new_tokens")
452
  if start_index != -1 and end_index != -1:
453
  raise gr.Error(error_message[start_index:end_index].strip()) from e
454
  else: