Skip to content

Commit

Permalink
add new prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
gkucsko committed Apr 17, 2023
1 parent d621ee3 commit 2345898
Show file tree
Hide file tree
Showing 157 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ text_prompt = """
I have a silky smooth voice, and today I will tell you about
the exercise regimen of the common sloth.
"""
audio_array = generate_audio(text_prompt, history_prompt="speech_0")
audio_array = generate_audio(text_prompt, history_prompt="en_speaker_1")
```

[sloth.webm](https://user-images.githubusercontent.com/5068315/230684883-a344c619-a560-4ff5-8b99-b4463a34487b.webm)
Expand Down
File renamed without changes.
Binary file added bark/assets/prompts/de_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/de_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/en_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/es_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/fr_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/hi_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/it_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/ja_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/ko_speaker_9.npz
Binary file not shown.
Binary file removed bark/assets/prompts/music_0.npz
Binary file not shown.
Binary file removed bark/assets/prompts/music_1.npz
Binary file not shown.
Binary file removed bark/assets/prompts/music_2.npz
Binary file not shown.
Binary file removed bark/assets/prompts/music_3.npz
Binary file not shown.
Binary file removed bark/assets/prompts/music_4.npz
Binary file not shown.
Binary file removed bark/assets/prompts/music_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/pl_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/pt_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/ru_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/speaker_9.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_1.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_2.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_3.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_4.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_5.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_6.npz
Binary file not shown.
Binary file removed bark/assets/prompts/speech_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/tr_speaker_9.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_0.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_1.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_2.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_3.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_4.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_5.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_6.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_7.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_8.npz
Binary file not shown.
Binary file added bark/assets/prompts/zh_speaker_9.npz
Binary file not shown.
31 changes: 27 additions & 4 deletions bark/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,26 @@ def autocast():
SAMPLE_RATE = 24_000


ALLOWED_PROMPTS = set(
[f"speech_{n}" for n in range(8)] +
[f"music_{n}" for n in range(6)]
)
SUPPORTED_LANGS = [
("English", "en"),
("German", "de"),
("Spanish", "es"),
("French", "fr"),
("Hindi", "hi"),
("Italian", "it"),
("Japanese", "ja"),
("Korean", "ko"),
("Polish", "pl"),
("Portuguese", "pt"),
("Russian", "ru"),
("Turkish", "tr"),
("Chinese", "zh"),
]

ALLOWED_PROMPTS = {"announcer"}
for _, lang in SUPPORTED_LANGS:
for n in range(10):
ALLOWED_PROMPTS.add(f"{lang}_speaker_{n}")


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -83,6 +99,13 @@ def autocast():
}


if not hasattr(torch.nn.functional, 'scaled_dot_product_attention'):
logger.warning(
"torch version does not support flash attention. You will get significantly faster" +
" inference speed by upgrade torch to newest version / nightly."
)


def _string_md5(s):
m = hashlib.md5()
m.update(s.encode("utf-8"))
Expand Down
File renamed without changes.

0 comments on commit 2345898

Please sign in to comment.