bark
bark copied to clipboard
Huggingface config min_eos_p
min_eos_p is a documented option for using the Bark API. Is there a way to configure this via the transformers python module in either the BarkModel or AutoProcessor?
You can set this option when call model.generate() function.
The default value of min_eos_p is 0.2, temperature(also known as temp in Bark API) is 0.7.
import scipy
from transformers import AutoProcessor, BarkModel
processor = AutoProcessor.from_pretrained("/path/to/bark/model")
model = BarkModel.from_pretrained("/path/to/bark/model")
inputs = processor("some text here", voice_preset="v2/en_speaker_3")
audio_array = model.generate(
**inputs,
min_eos_p=0.05,
temperature=0.6
)
audio_array = audio_array.cpu().numpy().squeeze()
scipy.io.wavfile.write("bark_out.wav", rate=model.generation_config.sample_rate, data=audio_array)