Update README.md
Browse files
README.md
CHANGED
@@ -6,4 +6,37 @@ base_model:
|
|
6 |
---
|
7 |
|
8 |
|
9 |
-
A finetuned version of MiniCPM-V 2.6 on GQA-it: Italian Question Answering on Image Scene Graph
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
---
|
7 |
|
8 |
|
9 |
+
<h1>A finetuned version of MiniCPM-V 2.6 on GQA-it: Italian Question Answering on Image Scene Graph</h1>
|
10 |
+
|
11 |
+
|
12 |
+
# Usage
|
13 |
+
Checkout the github repository for more insights and codes: https://github.com/crux82/XXXXXX
|
14 |
+
|
15 |
+
```python
|
16 |
+
import torch
|
17 |
+
from PIL import Image
|
18 |
+
from transformers import AutoModel, AutoTokenizer,AutoProcessor
|
19 |
+
|
20 |
+
model = AutoModel.from_pretrained('sag-uniroma2/MiniCPM-V-2_6-gqa-it-finetuned', trust_remote_code=True,
|
21 |
+
attn_implementation='sdpa', torch_dtype=torch.bfloat16)
|
22 |
+
model = model.eval().cuda()
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V-2_6', trust_remote_code=True)
|
24 |
+
img="xx.jpg"
|
25 |
+
image = Image.open(img).convert('RGB')
|
26 |
+
|
27 |
+
question = "C'è un idrante sull'erba?"
|
28 |
+
msgs = [{'role': 'user', 'content': [image,question]}]
|
29 |
+
|
30 |
+
answer = model.chat(
|
31 |
+
image=None,
|
32 |
+
msgs=msgs,
|
33 |
+
tokenizer=tokenizer
|
34 |
+
)
|
35 |
+
print(answer)
|
36 |
+
|
37 |
+
```
|
38 |
+
|
39 |
+
# Citation
|
40 |
+
```
|
41 |
+
TODO
|
42 |
+
```
|