Commit
•
af35db7
1
Parent(s):
c1d64c3
Update README.md
Browse files
README.md
CHANGED
@@ -7,6 +7,32 @@ tags: []
|
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
## Model Details
|
|
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
10 |
+
```python
|
11 |
+
from transformers import Idefics2Config, AutoProcessor, MistralConfig, Idefics2ForConditionalGeneration
|
12 |
+
from transformers.models.idefics2.configuration_idefics2 import Idefics2VisionConfig
|
13 |
+
|
14 |
+
config = Idefics2Config(
|
15 |
+
text_config=MistralConfig(
|
16 |
+
max_position_embeddings=4096 * 8,
|
17 |
+
vocab_size=32003,
|
18 |
+
hidden_size=4 * 8,
|
19 |
+
num_attention_heads=8,
|
20 |
+
intermediate_size=16,
|
21 |
+
num_hidden_layers=2,
|
22 |
+
),
|
23 |
+
vision_config=Idefics2VisionConfig(
|
24 |
+
hidden_size=8 * 4,
|
25 |
+
num_attention_heads=4,
|
26 |
+
num_hidden_layers=2,
|
27 |
+
intermediate_size=16,
|
28 |
+
),
|
29 |
+
)
|
30 |
+
model = Idefics2ForConditionalGeneration(config=config)
|
31 |
+
processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics2-8b")
|
32 |
+
|
33 |
+
model.push_to_hub("trl-internal-testing/tiny-random-idefics2")
|
34 |
+
processor.push_to_hub("trl-internal-testing/tiny-random-idefics2")
|
35 |
+
```
|
36 |
|
37 |
|
38 |
## Model Details
|