Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -76,12 +76,12 @@ def navigate(screenshot, task: str, platform: str, history):
|
|
76 |
else:
|
77 |
messages = history
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
|
86 |
prompt_header = (
|
87 |
"You are a GUI agent. You are given a task and your action history, with screenshots."
|
|
|
76 |
else:
|
77 |
messages = history
|
78 |
|
79 |
+
for message in messages:
|
80 |
+
if message['role'] == 'user' and isinstance(message.get('content'), list):
|
81 |
+
for item in message['content']:
|
82 |
+
if item.get('type') == 'image' and isinstance(item.get('image'), str):
|
83 |
+
# This is a base64 string, convert it to a PIL image
|
84 |
+
item['image'] = load_base64_to_pil(item['image'])
|
85 |
|
86 |
prompt_header = (
|
87 |
"You are a GUI agent. You are given a task and your action history, with screenshots."
|