Spaces:
Running
Running
jiang
commited on
Commit
•
6bd1b64
1
Parent(s):
cbe5e70
update
Browse files
demo.py
CHANGED
@@ -265,14 +265,14 @@ def visual_grounding(image, text):
|
|
265 |
attn_masks = []
|
266 |
while i < max_len and unfinish_flag.any():
|
267 |
# print(i)
|
268 |
-
prev_output_tokens_11_tensor = torch.tensor(np.array(prev_output_token_11)).
|
269 |
-
prev_output_tokens_12_tensor = torch.tensor(np.array(prev_output_token_12)).
|
270 |
-
prev_output_tokens_21_tensor = torch.tensor(np.array(prev_output_token_21)).
|
271 |
-
prev_output_tokens_22_tensor = torch.tensor(np.array(prev_output_token_22)).
|
272 |
-
delta_x1_tensor = torch.tensor(np.array(delta_x1)).
|
273 |
-
delta_x2_tensor = torch.tensor(np.array(delta_x2)).
|
274 |
-
delta_y1_tensor = torch.tensor(np.array(delta_y1)).
|
275 |
-
delta_y2_tensor = torch.tensor(np.array(delta_y2)).
|
276 |
|
277 |
net_output = model.decoder(
|
278 |
prev_output_tokens_11_tensor,
|
|
|
265 |
attn_masks = []
|
266 |
while i < max_len and unfinish_flag.any():
|
267 |
# print(i)
|
268 |
+
prev_output_tokens_11_tensor = torch.tensor(np.array(prev_output_token_11)).long()
|
269 |
+
prev_output_tokens_12_tensor = torch.tensor(np.array(prev_output_token_12)).long()
|
270 |
+
prev_output_tokens_21_tensor = torch.tensor(np.array(prev_output_token_21)).long()
|
271 |
+
prev_output_tokens_22_tensor = torch.tensor(np.array(prev_output_token_22)).long()
|
272 |
+
delta_x1_tensor = torch.tensor(np.array(delta_x1)).float()
|
273 |
+
delta_x2_tensor = torch.tensor(np.array(delta_x2)).float()
|
274 |
+
delta_y1_tensor = torch.tensor(np.array(delta_y1)).float()
|
275 |
+
delta_y2_tensor = torch.tensor(np.array(delta_y2)).float()
|
276 |
|
277 |
net_output = model.decoder(
|
278 |
prev_output_tokens_11_tensor,
|