Instructions to use suno/bark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use suno/bark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="suno/bark")# Load model directly from transformers import AutoProcessor, AutoModelForTextToWaveform processor = AutoProcessor.from_pretrained("suno/bark") model = AutoModelForTextToWaveform.from_pretrained("suno/bark") - Notebooks
- Google Colab
- Kaggle
When executing text-to-speech task, an Error occurs.
I have an error when running text-to-speech example code. The error is :
'''The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask to obtain reliable results.
Setting pad_token_id to eos_token_id:10000 for open-end generation.
Traceback (most recent call last):
File "d:\projects\vscode\huggingface\text2audio.py", line 8, in
scipy.io.wavfile.write("bark_out.wav", rate=speech["sampling_rate"], data=speech["audio"])
File "D:\anaconda3\Lib\site-packages\scipy\io\wavfile.py", line 797, in write
fmt_chunk_data = struct.pack('<HHIIHH', format_tag, channels, fs,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: ushort format requires 0 <= number <= 65535'''
Me too.