Spaces:
Sleeping
Sleeping
Indent error
Browse files- Gradio_UI.py +12 -12
Gradio_UI.py
CHANGED
|
@@ -192,20 +192,20 @@ class GradioUI:
|
|
| 192 |
os.mkdir(file_upload_folder)
|
| 193 |
|
| 194 |
def interact_with_agent(self, prompt, messages, current_image):
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
|
|
|
|
|
|
| 205 |
yield messages, new_image
|
| 206 |
|
| 207 |
-
yield messages, new_image
|
| 208 |
-
|
| 209 |
def upload_file(
|
| 210 |
self,
|
| 211 |
file,
|
|
|
|
| 192 |
os.mkdir(file_upload_folder)
|
| 193 |
|
| 194 |
def interact_with_agent(self, prompt, messages, current_image):
|
| 195 |
+
import gradio as gr
|
| 196 |
+
|
| 197 |
+
messages.append(gr.ChatMessage(role="user", content=prompt))
|
| 198 |
+
yield messages, current_image
|
| 199 |
+
|
| 200 |
+
new_image = current_image
|
| 201 |
+
for msg, image_path in stream_to_gradio(self.agent, task=prompt, reset_agent_memory=False):
|
| 202 |
+
messages.append(msg)
|
| 203 |
+
if image_path is not None:
|
| 204 |
+
new_image = image_path
|
| 205 |
+
yield messages, new_image
|
| 206 |
+
|
| 207 |
yield messages, new_image
|
| 208 |
|
|
|
|
|
|
|
| 209 |
def upload_file(
|
| 210 |
self,
|
| 211 |
file,
|