Update app.py
Browse files
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("
|
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("
|
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("
|
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("
|
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("
|
384 |
if start_index != -1 and end_index != -1:
|
385 |
raise gr.Error(error_message[start_index:end_index].strip()) from e
|
386 |
else:
|
@@ -496,7 +496,7 @@ def Explore_WebSite(history, messages6):
|
|
496 |
except Exception as e:
|
497 |
error_message = str(e)
|
498 |
start_index = error_message.find("Input validation error:")
|
499 |
-
end_index = error_message.find("and 4096 max_new_tokens
|
500 |
if start_index != -1 and end_index != -1:
|
501 |
raise gr.Error(error_message[start_index:end_index].strip()) from e
|
502 |
else:
|
@@ -608,7 +608,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
608 |
with gr.Column():
|
609 |
with gr.Row():
|
610 |
filepath = gr.UploadButton("Upload a file", file_count="single", scale=1)
|
611 |
-
msg = gr.Textbox(show_label=False, placeholder="
|
612 |
submit = gr.Button("➡️Send", scale=1)
|
613 |
with gr.Row():
|
614 |
file_output = gr.HTML("<div style='height: 20px; width: 30px;'></div>")
|
|
|
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`")
|
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("and 4096 `max_new_tokens`")
|
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("and 4096 `max_new_tokens`")
|
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("and 4096 `max_new_tokens`")
|
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("and 4096 `max_new_tokens`")
|
384 |
if start_index != -1 and end_index != -1:
|
385 |
raise gr.Error(error_message[start_index:end_index].strip()) from e
|
386 |
else:
|
|
|
496 |
except Exception as e:
|
497 |
error_message = str(e)
|
498 |
start_index = error_message.find("Input validation error:")
|
499 |
+
end_index = error_message.find("and 4096 `max_new_tokens`")
|
500 |
if start_index != -1 and end_index != -1:
|
501 |
raise gr.Error(error_message[start_index:end_index].strip()) from e
|
502 |
else:
|
|
|
608 |
with gr.Column():
|
609 |
with gr.Row():
|
610 |
filepath = gr.UploadButton("Upload a file", file_count="single", scale=1)
|
611 |
+
msg = gr.Textbox(show_label=False, placeholder="Wait until the file has been uploaded, then type a message....", scale=7, container=False)
|
612 |
submit = gr.Button("➡️Send", scale=1)
|
613 |
with gr.Row():
|
614 |
file_output = gr.HTML("<div style='height: 20px; width: 30px;'></div>")
|