Now Reading
bark/ at major · suno-ai/bark · GitHub

bark/ at major · suno-ai/bark · GitHub

2023-05-14 21:01:08


ExamplesSuno Studio WaitlistUpdatesHow to UseInstallationFAQ

Bark is a transformer-based text-to-audio mannequin created by Suno. Bark can generate extremely life like, multilingual speech in addition to different audio – together with music, background noise and easy sound results. The mannequin may produce nonverbal communications like laughing, sighing and crying. To help the analysis group, we’re offering entry to pretrained mannequin checkpoints, that are prepared for inference and accessible for industrial use.


Bark was developed for analysis functions. It’s not a traditional text-to-speech mannequin however as a substitute a completely generative text-to-audio mannequin, which might deviate in surprising methods from offered prompts. Suno doesn’t take accountability for any output generated. Use at your individual danger, and please act responsibly.

???? Demos

Open in Spaces
Open on Replicate
Open In Colab

???? Updates


  • ©️ Bark is now licensed below the MIT License, which means it is now accessible for industrial use!

  • 2x speed-up on GPU. 10x speed-up on CPU. We additionally added an choice for a smaller model of Bark, which provides extra speed-up with the trade-off of barely decrease high quality.

  • ???? Long-form generation, voice consistency enhancements and different examples are actually documented in a brand new notebooks part.

  • ???? We created a voice prompt library. We hope this useful resource helps you discover helpful prompts on your use instances! You can too be part of us on Discord, the place the group actively shares helpful prompts within the #audio-prompts channel.

  • ???? Rising group help and entry to new options right here:

  • ???? Now you can use Bark with GPUs which have low VRAM (<4GB).


???? Utilization in Python

???? Fundamentals

from bark import SAMPLE_RATE, generate_audio, preload_models
from import write as write_wav
from import Audio

# obtain and cargo all fashions

# generate audio from textual content
text_prompt = """
     Hiya, my identify is Suno. And, uh — and I like pizza. [laughs] 
     However I additionally produce other pursuits resembling enjoying tic tac toe.
audio_array = generate_audio(text_prompt)

# save audio to disk
write_wav("bark_generation.wav", SAMPLE_RATE, audio_array)
# play textual content in pocket book
Audio(audio_array, price=SAMPLE_RATE)


???? Overseas Language

Bark helps varied languages out-of-the-box and mechanically determines language from enter textual content. When prompted with code-switched textual content, Bark will try and make use of the native accent for the respective languages. English high quality is finest in the interim, and we anticipate different languages to additional enhance with scaling.

text_prompt = """
    추석은 내가 가장 좋아하는 명절이다. 나는 며칠 동안 휴식을 취하고 친구 및 가족과 시간을 보낼 수 있습니다.
audio_array = generate_audio(text_prompt)


Observe: since Bark acknowledges languages mechanically from enter textual content, it’s potential to make use of for instance a german historical past immediate with english textual content. This often results in english audio with a german accent.

???? Music

Bark can generate all varieties of audio, and, in precept, would not see a distinction between speech and music. Generally Bark chooses to generate textual content as music, however you may assist it out by including music notes round your lyrics.

text_prompt = """
    ♪ Within the jungle, the mighty jungle, the lion barks tonight ♪
audio_array = generate_audio(text_prompt)


???? Voice Presets

Bark helps 100+ speaker presets throughout supported languages. You’ll be able to browse the library of speaker presets here, or within the code. The group additionally usually shares presets in Discord.

Bark tries to match the tone, pitch, emotion and prosody of a given preset, however doesn’t at present help customized voice cloning. The mannequin additionally makes an attempt to protect music, ambient noise, and so forth.

text_prompt = """
    I've a silky clean voice, and at this time I'll let you know about 
    the train routine of the frequent sloth.
audio_array = generate_audio(text_prompt, history_prompt="v2/en_speaker_1")


Producing Longer Audio

By default, generate_audio works nicely with round 13 seconds of spoken textual content. For an instance of find out how to do long-form era, see this example notebook.

Click on to toggle instance long-form generations (from the instance pocket book)




See Also

???? Set up

pip set up git+


git clone
cd bark && pip set up . 

Observe: Do NOT use ‘pip set up bark’. It installs a special bundle, which isn’t managed by Suno.

????️ {Hardware} and Inference Velocity

Bark has been examined and works on each CPU and GPU (pytorch 2.0+, CUDA 11.7 and CUDA 12.0).

On enterprise GPUs and PyTorch nightly, Bark can generate audio in roughly real-time. On older GPUs, default colab, or CPU, inference time could be considerably slower. For older GPUs or CPU you may need to think about using smaller fashions. Particulars may be present in out tutorial sections right here.

The total model of Bark requires round 12GB of VRAM to carry every little thing on GPU on the identical time.
To make use of a smaller model of the fashions, which ought to match into 8GB VRAM, set the atmosphere flag SUNO_USE_SMALL_MODELS=True.

If you do not have {hardware} accessible or if you wish to play with larger variations of our fashions, you can even join early entry to our mannequin playground here.

⚙️ Particulars

Bark is totally generative tex-to-audio mannequin devolved for analysis and demo functions. It follows a GPT model structure much like AudioLM and Vall-E and a quantized Audio illustration from EnCodec. It’s not a traditional TTS mannequin, however as a substitute a completely generative text-to-audio mannequin able to deviating in surprising methods from any given script. Totally different to earlier approaches, the enter textual content immediate is transformed on to audio with out the intermediate use of phonemes. It might probably subsequently generalize to arbitrary directions past speech resembling music lyrics, sound results or different non-speech sounds.

Under is an inventory of some recognized non-speech sounds, however we’re discovering extra every single day. Please tell us in the event you discover patterns that work notably nicely on Discord!

  • [laughter]
  • [laughs]
  • [sighs]
  • [music]
  • [gasps]
  • [clears throat]
  • or ... for hesitations
  • for track lyrics
  • CAPITALIZATION for emphasis of a phrase
  • [MAN] and [WOMAN] to bias Bark towards female and male audio system, respectively

Supported Languages

Language Standing
English (en)
German (de)
Spanish (es)
French (fr)
Hindi (hello)
Italian (it)
Japanese (ja)
Korean (ko)
Polish (pl)
Portuguese (pt)
Russian (ru)
Turkish (tr)
Chinese language, simplified (zh)

Requests for future language help here or within the #boards channel on Discord.

???? Appreciation

  • nanoGPT for a dead-simple and blazing quick implementation of GPT-style fashions
  • EnCodec for a state-of-the-art implementation of a implausible audio codec
  • AudioLM for associated coaching and inference code
  • Vall-E, AudioLM and lots of different ground-breaking papers that enabled the event of Bark

© License

Bark is licensed below the MIT License.

Please contact us at to request entry to a bigger model of the mannequin.

???? Neighborhood

???? Suno Studio (Early Entry)

We’re creating a playground for our fashions, together with Bark.

In case you are , you may join early entry here.


How do I specify the place fashions are downloaded and cached?

  • Bark makes use of Hugging Face to obtain and retailer fashions. You’ll be able to see discover extra information here.

Bark’s generations generally differ from my prompts. What’s taking place?

  • Bark is a GPT-style mannequin. As such, it might take some inventive liberties in its generations, leading to higher-variance mannequin outputs than conventional text-to-speech approaches.

What voices are supported by Bark?

  • Bark helps 100+ speaker presets throughout supported languages. You’ll be able to browse the library of speaker presets here. The group additionally shares presets in Discord. Bark additionally helps producing distinctive random voices that match the enter textual content. Bark doesn’t at present help customized voice cloning.

Why is the output restricted to ~13-14 seconds?

  • Bark is a GPT-style mannequin, and its structure/context window is optimized to output generations with roughly this size.

How a lot VRAM do I would like?

  • The total model of Bark requires round 12Gb of reminiscence to carry every little thing on GPU on the identical time. Nonetheless, even smaller playing cards all the way down to ~2Gb work with some extra settings. Merely add the next code snippet earlier than your era:
import os
os.environ["SUNO_OFFLOAD_CPU"] = True
os.environ["SUNO_USE_SMALL_MODELS"] = True

My generated audio appears like a Nineteen Eighties cellphone name. What’s taking place?

  • Bark generates audio from scratch. It’s not meant to create solely high-fidelity, studio-quality speech. Fairly, outputs might be something from excellent speech to a number of individuals arguing at a baseball recreation recorded with dangerous microphones.

Source Link

What's Your Reaction?
In Love
Not Sure
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top