Instructions to use onnx-community/Voxtral-Mini-3B-2507-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use onnx-community/Voxtral-Mini-3B-2507-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('audio-text-to-text', 'onnx-community/Voxtral-Mini-3B-2507-ONNX');
File size: 989 Bytes
1db26fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | {{- bos_token -}}
{%- for message in messages -%}
{%- if (message["role"] == "user") == (loop.index % 2 == 0) -%}
{{- raise_exception("After the optional system message, conversation roles must alternate user/assistant/user/assistant/...") -}}
{%- endif -%}
{%- if message["role"] == "user" -%}
{{- "[INST]" -}}
{%- if message["content"] is string -%}
{{- message["content"] -}}
{%- else -%}
{%- for item in message["content"] -%}
{%- if item["type"] == "audio" -%}
{{- "[AUDIO]" -}}
{%- elif item["type"] == "text" -%}
{{- item["text"] -}}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{{- "[/INST]" -}}
{%- elif message["role"] == "assistant" -%}
{%- if message["content"] is not string -%}
{{- raise_exception("Assistant message content should be a string.") -}}
{%- endif -%}
{{- message["content"] + eos_token -}}
{%- else -%}
{{- raise_exception("Only user and assistant roles are supported!") -}}
{%- endif -%}
{%- endfor -%} |