Spaces:
Runtime error
Runtime error
Commit
·
2e08e3b
1
Parent(s):
8230224
Update main.py
Browse files
main.py
CHANGED
@@ -97,14 +97,11 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
97 |
|
98 |
# Process initial actions if there are not enough previous actions
|
99 |
while len(previous_actions) < 8:
|
100 |
-
|
101 |
-
|
102 |
-
previous_actions.insert(0, ("move", unnorm_coords(x, y)))
|
103 |
-
else:
|
104 |
-
break
|
105 |
prev_x = 0
|
106 |
prev_y = 0
|
107 |
-
for action_type, pos in previous_actions[-
|
108 |
if action_type == "move":
|
109 |
x, y = pos
|
110 |
norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
@@ -117,7 +114,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
117 |
elif action_type == "right_click":
|
118 |
action_descriptions.append("right_click")
|
119 |
|
120 |
-
prompt = " ".join(action_descriptions)
|
121 |
print(prompt)
|
122 |
|
123 |
# Generate the next frame
|
|
|
97 |
|
98 |
# Process initial actions if there are not enough previous actions
|
99 |
while len(previous_actions) < 8:
|
100 |
+
x, y = map(int, initial_actions.pop(0).split(':'))
|
101 |
+
previous_actions.insert(0, ("move", unnorm_coords(x, y)))
|
|
|
|
|
|
|
102 |
prev_x = 0
|
103 |
prev_y = 0
|
104 |
+
for action_type, pos in previous_actions: #[-8:]:
|
105 |
if action_type == "move":
|
106 |
x, y = pos
|
107 |
norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
|
|
114 |
elif action_type == "right_click":
|
115 |
action_descriptions.append("right_click")
|
116 |
|
117 |
+
prompt = " ".join(action_descriptions[-8:])
|
118 |
print(prompt)
|
119 |
|
120 |
# Generate the next frame
|