Spaces:
Running
on
Zero
Running
on
Zero
Update utils/model.py
Browse files- utils/model.py +1 -1
utils/model.py
CHANGED
@@ -427,7 +427,7 @@ class OwlViTForClassification(nn.Module):
|
|
427 |
|
428 |
device_ = txt_embeds.device
|
429 |
position_ids = position_ids.to(device_)
|
430 |
-
position_embedding =
|
431 |
text_inputs_parts["position_ids"] = position_ids
|
432 |
print(f"pos + emb: {(txt_embeds + position_embedding).shape}")
|
433 |
text_embeds_parts = self.owlvit.text_model.get_text_features(**text_inputs_parts)
|
|
|
427 |
|
428 |
device_ = txt_embeds.device
|
429 |
position_ids = position_ids.to(device_)
|
430 |
+
position_embedding = position_ids.repeat(position_ids.size(0), 1, 1)
|
431 |
text_inputs_parts["position_ids"] = position_ids
|
432 |
print(f"pos + emb: {(txt_embeds + position_embedding).shape}")
|
433 |
text_embeds_parts = self.owlvit.text_model.get_text_features(**text_inputs_parts)
|