mirror of
https://github.com/serp-ai/bark-with-voice-clone.git
synced 2025-12-15 03:07:58 +01:00
add more prompts
This commit is contained in:
@@ -80,7 +80,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="man-narrator")
|
||||
audio_array = generate_audio(text_prompt, history_prompt="speech_0")
|
||||
```
|
||||
|
||||
[sloth.webm](https://user-images.githubusercontent.com/5068315/230684883-a344c619-a560-4ff5-8b99-b4463a34487b.webm)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
bark/assets/prompts/music_0.npz
Normal file
BIN
bark/assets/prompts/music_0.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/music_1.npz
Normal file
BIN
bark/assets/prompts/music_1.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/music_2.npz
Normal file
BIN
bark/assets/prompts/music_2.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/music_3.npz
Normal file
BIN
bark/assets/prompts/music_3.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/music_4.npz
Normal file
BIN
bark/assets/prompts/music_4.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/music_5.npz
Normal file
BIN
bark/assets/prompts/music_5.npz
Normal file
Binary file not shown.
Binary file not shown.
BIN
bark/assets/prompts/speech_1.npz
Normal file
BIN
bark/assets/prompts/speech_1.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/speech_2.npz
Normal file
BIN
bark/assets/prompts/speech_2.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/speech_3.npz
Normal file
BIN
bark/assets/prompts/speech_3.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/speech_4.npz
Normal file
BIN
bark/assets/prompts/speech_4.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/speech_5.npz
Normal file
BIN
bark/assets/prompts/speech_5.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/speech_6.npz
Normal file
BIN
bark/assets/prompts/speech_6.npz
Normal file
Binary file not shown.
BIN
bark/assets/prompts/speech_7.npz
Normal file
BIN
bark/assets/prompts/speech_7.npz
Normal file
Binary file not shown.
@@ -49,10 +49,9 @@ COARSE_RATE_HZ = 75
|
||||
SAMPLE_RATE = 24_000
|
||||
|
||||
|
||||
ALLOWED_PROMPTS = (
|
||||
"brylcream",
|
||||
"es-woman",
|
||||
"man-narrator",
|
||||
ALLOWED_PROMPTS = set(
|
||||
[f"speech_{n}" for n in range(8)] +
|
||||
[f"music_{n}" for n in range(6)]
|
||||
)
|
||||
|
||||
|
||||
@@ -307,7 +306,7 @@ def generate_text_semantic(
|
||||
assert (history_prompt in ALLOWED_PROMPTS)
|
||||
semantic_history = np.load(
|
||||
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
||||
)["text"]
|
||||
)["semantic_prompt"]
|
||||
assert (
|
||||
isinstance(semantic_history, np.ndarray)
|
||||
and len(semantic_history.shape) == 1
|
||||
@@ -452,8 +451,8 @@ def generate_coarse(
|
||||
x_history = np.load(
|
||||
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
||||
)
|
||||
x_semantic_history = x_history["coarse_1"]
|
||||
x_coarse_history = x_history["coarse_2"]
|
||||
x_semantic_history = x_history["semantic_prompt"]
|
||||
x_coarse_history = x_history["coarse_prompt"]
|
||||
assert (
|
||||
isinstance(x_semantic_history, np.ndarray)
|
||||
and len(x_semantic_history.shape) == 1
|
||||
@@ -594,7 +593,7 @@ def generate_fine(
|
||||
assert (history_prompt in ALLOWED_PROMPTS)
|
||||
x_fine_history = np.load(
|
||||
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
||||
)["fine"]
|
||||
)["fine_prompt"]
|
||||
assert (
|
||||
isinstance(x_fine_history, np.ndarray)
|
||||
and len(x_fine_history.shape) == 2
|
||||
|
||||
Reference in New Issue
Block a user