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