mou3az commited on
Commit
1d37214
·
verified ·
1 Parent(s): 509eb43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -218,7 +218,7 @@ def Chat_Message(history, messages1):
218
  start_index = error_message.find("Input validation error:")
219
  end_index = error_message.find("and 4096 `max_new_tokens`")
220
  if start_index != -1 and end_index != -1:
221
- messages1.pop()
222
  raise gr.Error(error_message[start_index:end_index].strip()) from e
223
  else:
224
  raise gr.Error("Error occurred during response") from e
@@ -264,7 +264,7 @@ def Internet_Search(history, messages2):
264
  start_index = error_message.find("Input validation error:")
265
  end_index = error_message.find("and 4096 `max_new_tokens`")
266
  if start_index != -1 and end_index != -1:
267
- messages2.pop()
268
  raise gr.Error(error_message[start_index:end_index].strip()) from e
269
  else:
270
  raise gr.Error("Error occurred during response") from e
@@ -302,7 +302,7 @@ def Chart_Generator(history, messages3):
302
  start_index = error_message.find("Input validation error:")
303
  end_index = error_message.find("and 4096 `max_new_tokens`")
304
  if start_index != -1 and end_index != -1:
305
- messages3.pop()
306
  raise gr.Error(error_message[start_index:end_index].strip()) from e
307
  else:
308
  raise gr.Error("Error occurred during response") from e
@@ -327,7 +327,7 @@ def Chart_Generator(history, messages3):
327
  start_index = error_message.find("Input validation error:")
328
  end_index = error_message.find("and 4096 `max_new_tokens`")
329
  if start_index != -1 and end_index != -1:
330
- messages3.pop()
331
  raise gr.Error(error_message[start_index:end_index].strip()) from e
332
  else:
333
  raise gr.Error("Error occurred during response") from e
@@ -386,7 +386,7 @@ def Link_Scratch(history, messages4):
386
  start_index = error_message.find("Input validation error:")
387
  end_index = error_message.find("and 4096 `max_new_tokens`")
388
  if start_index != -1 and end_index != -1:
389
- messages4.pop()
390
  raise gr.Error(error_message[start_index:end_index].strip()) from e
391
  else:
392
  raise gr.Error("Error occurred during response") from e
@@ -455,7 +455,7 @@ def File_Interact(history, filepath, messages5):
455
  start_index = error_message.find("Input validation error:")
456
  end_index = error_message.find("and 4096 `max_new_tokens`")
457
  if start_index != -1 and end_index != -1:
458
- messages5.pop()
459
  raise gr.Error(error_message[start_index:end_index].strip()) from e
460
  else:
461
  raise gr.Error("Error occurred during response") from e
@@ -504,7 +504,7 @@ def Explore_WebSite(history, messages6):
504
  start_index = error_message.find("Input validation error:")
505
  end_index = error_message.find("and 4096 `max_new_tokens`")
506
  if start_index != -1 and end_index != -1:
507
- messages6.pop()
508
  raise gr.Error(error_message[start_index:end_index].strip()) from e
509
  else:
510
  raise gr.Error("Error occurred during response") from e
 
218
  start_index = error_message.find("Input validation error:")
219
  end_index = error_message.find("and 4096 `max_new_tokens`")
220
  if start_index != -1 and end_index != -1:
221
+ messages1 = messages1[:-2]
222
  raise gr.Error(error_message[start_index:end_index].strip()) from e
223
  else:
224
  raise gr.Error("Error occurred during response") from e
 
264
  start_index = error_message.find("Input validation error:")
265
  end_index = error_message.find("and 4096 `max_new_tokens`")
266
  if start_index != -1 and end_index != -1:
267
+ messages2 = messages2[:-2]
268
  raise gr.Error(error_message[start_index:end_index].strip()) from e
269
  else:
270
  raise gr.Error("Error occurred during response") from e
 
302
  start_index = error_message.find("Input validation error:")
303
  end_index = error_message.find("and 4096 `max_new_tokens`")
304
  if start_index != -1 and end_index != -1:
305
+ messages3 = messages3[:-2]
306
  raise gr.Error(error_message[start_index:end_index].strip()) from e
307
  else:
308
  raise gr.Error("Error occurred during response") from e
 
327
  start_index = error_message.find("Input validation error:")
328
  end_index = error_message.find("and 4096 `max_new_tokens`")
329
  if start_index != -1 and end_index != -1:
330
+ messages3 = messages3[:-2]
331
  raise gr.Error(error_message[start_index:end_index].strip()) from e
332
  else:
333
  raise gr.Error("Error occurred during response") from e
 
386
  start_index = error_message.find("Input validation error:")
387
  end_index = error_message.find("and 4096 `max_new_tokens`")
388
  if start_index != -1 and end_index != -1:
389
+ messages4 = messages4[:-2]
390
  raise gr.Error(error_message[start_index:end_index].strip()) from e
391
  else:
392
  raise gr.Error("Error occurred during response") from e
 
455
  start_index = error_message.find("Input validation error:")
456
  end_index = error_message.find("and 4096 `max_new_tokens`")
457
  if start_index != -1 and end_index != -1:
458
+ messages5 = messages5[:-2]
459
  raise gr.Error(error_message[start_index:end_index].strip()) from e
460
  else:
461
  raise gr.Error("Error occurred during response") from e
 
504
  start_index = error_message.find("Input validation error:")
505
  end_index = error_message.find("and 4096 `max_new_tokens`")
506
  if start_index != -1 and end_index != -1:
507
+ messages6 = messages6[:-2]
508
  raise gr.Error(error_message[start_index:end_index].strip()) from e
509
  else:
510
  raise gr.Error("Error occurred during response") from e