Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -63,8 +63,12 @@ def navigate(screenshot, task: str, platform: str, history):
|
|
63 |
f"## User Instruction\n{task}"
|
64 |
)
|
65 |
current = {"role":"user","content":[{"type":"text","text":prompt_header},{"type": "image_url", "image_url":screenshot}]}
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
68 |
|
69 |
# βββββββββββββββββββββββββββ model forward βββββββββββββββββββββββββββββ
|
70 |
|
@@ -82,6 +86,7 @@ def navigate(screenshot, task: str, platform: str, history):
|
|
82 |
)
|
83 |
print("\nimages\n:",images)
|
84 |
print("\ntext\n",text)
|
|
|
85 |
inputs = processor(
|
86 |
text=[text],
|
87 |
images=images,
|
|
|
63 |
f"## User Instruction\n{task}"
|
64 |
)
|
65 |
current = {"role":"user","content":[{"type":"text","text":prompt_header},{"type": "image_url", "image_url":screenshot}]}
|
66 |
+
if len(history)==0:
|
67 |
+
messages.append(current)
|
68 |
+
else:
|
69 |
+
current = {"role":"user","content":[{"type":"text","text":task},{"type": "image_url", "image_url":screenshot}]}
|
70 |
+
messages.append(current)
|
71 |
+
|
72 |
|
73 |
# βββββββββββββββββββββββββββ model forward βββββββββββββββββββββββββββββ
|
74 |
|
|
|
86 |
)
|
87 |
print("\nimages\n:",images)
|
88 |
print("\ntext\n",text)
|
89 |
+
print("\nmessages\n",messages)
|
90 |
inputs = processor(
|
91 |
text=[text],
|
92 |
images=images,
|