æLtorio
commited on
update readme
Browse files
README.md
CHANGED
@@ -30,10 +30,15 @@ This repository contains a fine-tuned version of the Hugging Face [Idefics3-8B-L
|
|
30 |
For immediate use, you can load the model directly from Hugging Face:
|
31 |
|
32 |
```python
|
|
|
33 |
import torch
|
34 |
-
|
35 |
-
|
36 |
-
model =
|
|
|
|
|
|
|
|
|
37 |
```
|
38 |
|
39 |
### Model Information
|
|
|
30 |
For immediate use, you can load the model directly from Hugging Face:
|
31 |
|
32 |
```python
|
33 |
+
from transformers import AutoProcessor, Idefics3ForConditionalGeneration, image_utils
|
34 |
import torch
|
35 |
+
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') # on CPU it requires ≈ 3h/query 🙈
|
36 |
+
processor = AutoProcessor.from_pretrained(v)
|
37 |
+
model = Idefics3ForConditionalGeneration.from_pretrained(
|
38 |
+
v, torch_dtype=torch.bfloat16
|
39 |
+
).to(device)
|
40 |
+
|
41 |
+
model.load_adapter("eltorio/IDEFICS3_ROCO")
|
42 |
```
|
43 |
|
44 |
### Model Information
|