Instructions to use HaochenWang/GAR-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HaochenWang/GAR-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="HaochenWang/GAR-8B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HaochenWang/GAR-8B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download chat_template.jinja from HaochenWang/GAR-8B: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/HaochenWang/GAR-8B/resolve/main/chat_template.jinja
- Command line
-
hf download hf://HaochenWang/GAR-8B/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/HaochenWang/GAR-8B/resolve/main/chat_template.jinja
1.07 kB
| {{- bos_token }}{%- if messages[0]['role'] == 'system' -%} {%- set system_message = messages[0]['content']|trim %} | |
| {%- set messages = messages[1:] %} | |
| {%- else %} {%- set system_message = 'You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language.' %}{%- endif %}{{- '<|start_header_id|>system<|end_header_id|>\n\n' }}{{- system_message }}{{- '<|eot_id|>' }}{%- for message in messages %}{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' }}{%- for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<|image|>' }}{%- endfor %}{%- for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '<|video|>' }}{%- endfor %}{%- for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{- content['text'] | trim }}{%- endfor %}{{'<|eot_id|>' }}{%- endfor %}{%- if add_generation_prompt %}{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{%- endif %} |