Instructions to use llava-hf/LLaVA-NeXT-Video-7B-DPO-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llava-hf/LLaVA-NeXT-Video-7B-DPO-hf with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("llava-hf/LLaVA-NeXT-Video-7B-DPO-hf") model = AutoModelForMultimodalLM.from_pretrained("llava-hf/LLaVA-NeXT-Video-7B-DPO-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download chat_template.json from llava-hf/LLaVA-NeXT-Video-7B-DPO-hf: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/llava-hf/LLaVA-NeXT-Video-7B-DPO-hf/resolve/main/chat_template.json
- Command line
-
hf download hf://llava-hf/LLaVA-NeXT-Video-7B-DPO-hf/chat_template.json
-
curl -L -o chat_template.json https://huggingface.co/llava-hf/LLaVA-NeXT-Video-7B-DPO-hf/resolve/main/chat_template.json
626 Bytes
| { | |
| "chat_template": "{% for message in messages %}{% if message['role'] != 'system' %}{{ message['role'].upper() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>\n' }}{% endfor %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '<video>\n' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + ' '}}{% endfor %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT:' }}{% endif %}" | |
| } |