xiangan commited on
Commit
e53d7f0
·
1 Parent(s): 7dd6f8f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +28 -0
README.md CHANGED
@@ -44,6 +44,13 @@ license: apache-2.0
44
 
45
  ### Quick Start
46
 
 
 
 
 
 
 
 
47
  > **Note:** This model supports native resolution input. For optimal performance:
48
  > - **Image**: 448×448 resolution (pre-trained)
49
  > - **Video**: 224×224 resolution with 256 tokens per frame (pre-trained)
@@ -96,6 +103,27 @@ with torch.no_grad():
96
  outputs = model(video, visible_indices=visible_indices)
97
  ```
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
  ### LMM Probe Results
101
 
 
44
 
45
  ### Quick Start
46
 
47
+
48
+ > [!IMPORTANT]
49
+ > **Transformers Version Compatibility:**
50
+ > - ✅ **`transformers==4.53.1`** (Recommended): Works with `AutoModel.from_pretrained()`
51
+ > - ⚠️ **`transformers>=5.0.0`**: Use source code installation (see [Loading from Source Code](#loading-from-source-code))
52
+
53
+
54
  > **Note:** This model supports native resolution input. For optimal performance:
55
  > - **Image**: 448×448 resolution (pre-trained)
56
  > - **Video**: 224×224 resolution with 256 tokens per frame (pre-trained)
 
103
  outputs = model(video, visible_indices=visible_indices)
104
  ```
105
 
106
+ ### Loading from Source Code
107
+
108
+ ```bash
109
+ git clone https://github.com/EvolvingLMMs-Lab/OneVision-Encoder.git
110
+ cd OneVision-Encoder
111
+ pip install -e .
112
+ ```
113
+
114
+ ```python
115
+ from onevision_encoder import OneVisionEncoderModel, OneVisionEncoderConfig
116
+ from transformers import AutoImageProcessor
117
+ model = OneVisionEncoderModel.from_pretrained(
118
+ "lmms-lab-encoder/onevision-encoder-large",
119
+ trust_remote_code=True,
120
+ attn_implementation="flash_attention_2"
121
+ ).to("cuda").eval()
122
+ preprocessor = AutoImageProcessor.from_pretrained(
123
+ "lmms-lab-encoder/onevision-encoder-large",
124
+ trust_remote_code=True
125
+ )
126
+ ```
127
 
128
  ### LMM Probe Results
129