Instructions to use hshispeech/Ruby-ASR-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hshispeech/Ruby-ASR-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="hshispeech/Ruby-ASR-1.7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hshispeech/Ruby-ASR-1.7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download subtitle/chat_template.json from hshispeech/Ruby-ASR-1.7B: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/hshispeech/Ruby-ASR-1.7B/resolve/main/subtitle/chat_template.json
- Command line
-
hf download hf://hshispeech/Ruby-ASR-1.7B/subtitle/chat_template.json
-
curl -L -o chat_template.json https://huggingface.co/hshispeech/Ruby-ASR-1.7B/resolve/main/subtitle/chat_template.json
1.16 kB
| {"chat_template": "{%- set ns = namespace(system_text=\"\") -%}\n{%- for m in messages -%}\n {%- if m.role == 'system' -%}\n {%- if m.content is string -%}\n {%- set ns.system_text = ns.system_text + m.content -%}\n {%- else -%}\n {%- for c in m.content -%}\n {%- if c.type == 'text' and (c.text is defined) -%}\n {%- set ns.system_text = ns.system_text + c.text -%}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n\n{%- set ns2 = namespace(audio_tokens=\"\") -%}\n{%- for m in messages -%}\n {%- if m.content is not string -%}\n {%- for c in m.content -%}\n {%- if c.type == 'audio' or ('audio' in c) or ('audio_url' in c) -%}\n {%- set ns2.audio_tokens = ns2.audio_tokens + \"<|audio_start|><|audio_pad|><|audio_end|>\" -%}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n{%- endfor -%}\n\n{{- '<|im_start|>system\\n' + (ns.system_text if ns.system_text is string else '') + '<|im_end|>\\n' -}}\n{{- '<|im_start|>user\\n' + ns2.audio_tokens + '<|im_end|>\\n' -}}\n{%- if add_generation_prompt -%}\n{{- '<|im_start|>assistant\\n' -}}\n{%- endif -%}"} |