Instructions to use llava-hf/LLaVA-NeXT-Video-7B-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-hf with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("llava-hf/LLaVA-NeXT-Video-7B-hf") model = AutoModelForMultimodalLM.from_pretrained("llava-hf/LLaVA-NeXT-Video-7B-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "chat_template": "{% for message in messages %}{% if message['role'] == 'system' %}{{ message['content'][0]['text'] }}{% else %}{{ 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 %}", | |
| "processor_class": "LlavaNextVideoProcessor" | |
| } |