Spaces:
Sleeping
Sleeping
gradio 5
Browse files
app.py
CHANGED
@@ -11,10 +11,6 @@ from botocore.config import Config
|
|
11 |
|
12 |
dump_controls = False
|
13 |
|
14 |
-
def undo(history):
|
15 |
-
history.pop()
|
16 |
-
return history
|
17 |
-
|
18 |
def dump(history):
|
19 |
return str(history)
|
20 |
|
@@ -179,11 +175,11 @@ with gr.Blocks(delete_cache=(86400, 86400)) as demo:
|
|
179 |
dl_settings_button.click(None, controls, js=generate_download_settings_js("amz_chat_settings.bin", control_ids))
|
180 |
ul_settings_button.click(None, None, None, js=generate_upload_settings_js(control_ids))
|
181 |
|
182 |
-
chat = gr.ChatInterface(fn=bot, multimodal=True, additional_inputs=controls,
|
183 |
chat.textbox.file_count = "multiple"
|
184 |
chatbot = chat.chatbot
|
185 |
chatbot.show_copy_button = True
|
186 |
-
chatbot.height =
|
187 |
|
188 |
if dump_controls:
|
189 |
with gr.Row():
|
|
|
11 |
|
12 |
dump_controls = False
|
13 |
|
|
|
|
|
|
|
|
|
14 |
def dump(history):
|
15 |
return str(history)
|
16 |
|
|
|
175 |
dl_settings_button.click(None, controls, js=generate_download_settings_js("amz_chat_settings.bin", control_ids))
|
176 |
ul_settings_button.click(None, None, None, js=generate_upload_settings_js(control_ids))
|
177 |
|
178 |
+
chat = gr.ChatInterface(fn=bot, multimodal=True, additional_inputs=controls, autofocus = False)
|
179 |
chat.textbox.file_count = "multiple"
|
180 |
chatbot = chat.chatbot
|
181 |
chatbot.show_copy_button = True
|
182 |
+
chatbot.height = 450
|
183 |
|
184 |
if dump_controls:
|
185 |
with gr.Row():
|
llm.py
CHANGED
@@ -58,7 +58,7 @@ class LLM:
|
|
58 |
user_msg_parts.append({"text": message["text"]})
|
59 |
if message["files"]:
|
60 |
for file in message["files"]:
|
61 |
-
user_msg_parts.extend(self._process_file(file
|
62 |
|
63 |
if user_msg_parts:
|
64 |
messages.append({"role": "user", "content": user_msg_parts})
|
|
|
58 |
user_msg_parts.append({"text": message["text"]})
|
59 |
if message["files"]:
|
60 |
for file in message["files"]:
|
61 |
+
user_msg_parts.extend(self._process_file(file))
|
62 |
|
63 |
if user_msg_parts:
|
64 |
messages.append({"role": "user", "content": user_msg_parts})
|