Views
No views yet
1import torch
2from PIL import Image
3from transformers import AutoModel, AutoTokenizer,AutoProcessor
4
5model = AutoModel.from_pretrained('sag-uniroma2/MiniCPM-V-2_6-gqa-it-finetuned', trust_remote_code=True,
6 attn_implementation='sdpa', torch_dtype=torch.bfloat16)
7model = model.eval().cuda()
8tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V-2_6', trust_remote_code=True)
9img="n346247.jpg"
10image = Image.open(img).convert('RGB')
11
12question = "C'è un idrante sull'erba?"
13msgs = [{'role': 'user', 'content': [image,question]}]
14
15answer = model.chat(
16 image=None,
17 msgs=msgs,
18 tokenizer=tokenizer
19)
20print(answer)
21
| Language | Question | Answer |
|---|---|---|
| En | Is the remote to the right or to the left of the book? | right |
| It | Il telecomando è a destra o a sinistra del libro? | destra |
| En | How thick is the book to the left of the remote? | thick |
| It | Quanto è spesso il libro a sinistra del telecomando? | spesso |
| En | What device is to the left of the calculator made of plastic? | charger |
| It | Quale dispositivo si trova a sinistra della calcolatrice di plastica? | caricabatterie |
| En | What's the charger made of? | plastic |
| It | Di cosa è fatto il caricabatterie? | plastica |
| En | Are there any phones? | no |
| It | Ci sono dei telefoni? | no |
@inproceedings{DBLP:conf/nl4ai/ScaiellaMHC024,
author={Antonio Scaiella and Daniele Margiotta and Claudiu Daniel Hromei and Danilo Croce and Roberto Basili},
title={Evaluating Multimodal Large Language Models for Visual Question-Answering in Italian},
year={2024},
cdate={1704067200000},
url={https://ceur-ws.org/Vol-3877/paper8.pdf},
booktitle={NL4AI@AI*IA},
crossref={conf/nl4ai/2024}
}