Instructions to use Marvis-AI/marvis-tts-250m-v0.1-transformers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Marvis-AI/marvis-tts-250m-v0.1-transformers with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="Marvis-AI/marvis-tts-250m-v0.1-transformers")# Load model directly from transformers import AutoProcessor, AutoModelForTextToWaveform processor = AutoProcessor.from_pretrained("Marvis-AI/marvis-tts-250m-v0.1-transformers") model = AutoModelForTextToWaveform.from_pretrained("Marvis-AI/marvis-tts-250m-v0.1-transformers", device_map="auto") - MLX
How to use Marvis-AI/marvis-tts-250m-v0.1-transformers with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir marvis-tts-250m-v0.1-transformers Marvis-AI/marvis-tts-250m-v0.1-transformers
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
| {%- for message in messages %} | |
| {%- if not message['role'] is string or not message['role'].isdigit() %} | |
| {{- raise_exception("Role must be a stringified integer speaker id.") }} | |
| {%- endif %} | |
| {%- set content = message['content'] %} | |
| {%- if content is not iterable or content is string %} | |
| {{- raise_exception("Content must be a list.") }} | |
| {%- endif %} | |
| {%- set texts = content | selectattr('type','equalto','text') | list %} | |
| {%- set audios = content | selectattr('type','equalto','audio') | list %} | |
| {%- if loop.last %} | |
| {%- if texts|length != 1 or audios|length != 0 %} | |
| {{- raise_exception("Last message must have one text and no audio.") }} | |
| {%- endif %} | |
| {%- else %} | |
| {%- if texts|length != 1 or audios|length != 1 %} | |
| {{- raise_exception("Each non-last message must have one text and one audio.") }} | |
| {%- endif %} | |
| {%- endif %} | |
| {%- endfor %} | |
| {{- bos_token }} | |
| {%- for message in messages %} | |
| {%- set text_item = message['content'] | selectattr('type','equalto','text') | list | first %} | |
| {%- if not loop.last -%} | |
| [{{ message['role'] }}]{{ text_item['text'] }}{{ " " }} | |
| {%- else -%} | |
| {{ text_item['text'] }} | |
| {%- endif -%} | |
| {%- endfor %} | |
| {{- eos_token }} | |
| {%- for message in messages %} | |
| {%- if not loop.last %} | |
| {{- '<|AUDIO|>' }} | |
| {%- endif %} | |
| {%- endfor %} |