Video-Text-to-Text
Transformers
Safetensors
English
qwen2
feature-extraction
multimodal
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use OpenGVLab/VideoChat-Flash-Qwen2_5-7B-1M_res224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/VideoChat-Flash-Qwen2_5-7B-1M_res224 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("OpenGVLab/VideoChat-Flash-Qwen2_5-7B-1M_res224", trust_remote_code=True) model = AutoModel.from_pretrained("OpenGVLab/VideoChat-Flash-Qwen2_5-7B-1M_res224", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -107,12 +107,13 @@ pip install flash-attn --no-build-isolation
|
|
| 107 |
Then you could use our model:
|
| 108 |
```python
|
| 109 |
from transformers import AutoModel, AutoTokenizer
|
|
|
|
| 110 |
|
| 111 |
# model setting
|
| 112 |
model_path = 'OpenGVLab/VideoChat-Flash-Qwen2_5-7B-1M_res224'
|
| 113 |
|
| 114 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 115 |
-
model = AutoModel.from_pretrained(model_path, trust_remote_code=True).
|
| 116 |
image_processor = model.get_vision_tower().image_processor
|
| 117 |
|
| 118 |
mm_llm_compress = False # use the global compress or not
|
|
|
|
| 107 |
Then you could use our model:
|
| 108 |
```python
|
| 109 |
from transformers import AutoModel, AutoTokenizer
|
| 110 |
+
import torch
|
| 111 |
|
| 112 |
# model setting
|
| 113 |
model_path = 'OpenGVLab/VideoChat-Flash-Qwen2_5-7B-1M_res224'
|
| 114 |
|
| 115 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 116 |
+
model = AutoModel.from_pretrained(model_path, trust_remote_code=True).to(torch.bfloat16).cuda()
|
| 117 |
image_processor = model.get_vision_tower().image_processor
|
| 118 |
|
| 119 |
mm_llm_compress = False # use the global compress or not
|