Update README.md
Browse files
README.md
CHANGED
|
@@ -31,7 +31,7 @@ text = " #instruction: guess what i want? \n #context: \"human: look that man in
|
|
| 31 |
with torch.no_grad():
|
| 32 |
pt_txt = tokenizer([text], return_tensors="pt").input_ids.cuda()
|
| 33 |
pt_img = image_processor([image], return_tensors="pt").pixel_values.to(torch.float16).cuda()
|
| 34 |
-
gen =
|
| 35 |
print(tokenizer.batch_decode(gen, skip_special_tokens=True))
|
| 36 |
# e.g. [' is he the one who just threw the ball?'] # Due to the generator, different results may be output
|
| 37 |
```
|
|
|
|
| 31 |
with torch.no_grad():
|
| 32 |
pt_txt = tokenizer([text], return_tensors="pt").input_ids.cuda()
|
| 33 |
pt_img = image_processor([image], return_tensors="pt").pixel_values.to(torch.float16).cuda()
|
| 34 |
+
gen = model.generate(pt_txt, patch_images=pt_img, top_p=0.5, do_sample=True, no_repeat_ngram_size=3, max_length=256)
|
| 35 |
print(tokenizer.batch_decode(gen, skip_special_tokens=True))
|
| 36 |
# e.g. [' is he the one who just threw the ball?'] # Due to the generator, different results may be output
|
| 37 |
```
|