Update modeling_gpt2vision.py
Browse files- modeling_gpt2vision.py +1 -1
modeling_gpt2vision.py
CHANGED
|
@@ -98,7 +98,7 @@ class GPT2Vision(PreTrainedModel):
|
|
| 98 |
|
| 99 |
|
| 100 |
def generate(self, question, image, max_new_tokens=30, **kwargs):
|
| 101 |
-
prompt = f"\n
|
| 102 |
print("prompt",prompt)
|
| 103 |
batch = {"image": [image], "text": prompt}
|
| 104 |
encoded_batch = self.tokenize_encode(batch, self.device)
|
|
|
|
| 98 |
|
| 99 |
|
| 100 |
def generate(self, question, image, max_new_tokens=30, **kwargs):
|
| 101 |
+
prompt = f"\n\nQuestion:<image>{question}\n\nAnswer:"
|
| 102 |
print("prompt",prompt)
|
| 103 |
batch = {"image": [image], "text": prompt}
|
| 104 |
encoded_batch = self.tokenize_encode(batch, self.device)
|