Update modeling_gpt2vision.py
Browse files- modeling_gpt2vision.py +1 -1
modeling_gpt2vision.py
CHANGED
|
@@ -61,6 +61,7 @@ class GPT2Vision(PreTrainedModel):
|
|
| 61 |
if isinstance(text, str):
|
| 62 |
text = [text]
|
| 63 |
input_texts = [f"{IMAGE_TOKEN}{t}" for t in text]
|
|
|
|
| 64 |
text_inputs = self.tokenizer(
|
| 65 |
input_texts,
|
| 66 |
padding='max_length',
|
|
@@ -86,7 +87,6 @@ class GPT2Vision(PreTrainedModel):
|
|
| 86 |
attention_mask = batch['attention_mask'].to(self.device)
|
| 87 |
|
| 88 |
img_embs = self.vision_encoder(images, device=self.device)
|
| 89 |
-
print("img_embs",img_embs)
|
| 90 |
img_embs = self.mlp(img_embs)
|
| 91 |
|
| 92 |
tok_embs = self.language_model.get_input_embeddings()(input_ids)
|
|
|
|
| 61 |
if isinstance(text, str):
|
| 62 |
text = [text]
|
| 63 |
input_texts = [f"{IMAGE_TOKEN}{t}" for t in text]
|
| 64 |
+
print(input_texts)
|
| 65 |
text_inputs = self.tokenizer(
|
| 66 |
input_texts,
|
| 67 |
padding='max_length',
|
|
|
|
| 87 |
attention_mask = batch['attention_mask'].to(self.device)
|
| 88 |
|
| 89 |
img_embs = self.vision_encoder(images, device=self.device)
|
|
|
|
| 90 |
img_embs = self.mlp(img_embs)
|
| 91 |
|
| 92 |
tok_embs = self.language_model.get_input_embeddings()(input_ids)
|