mirror of
https://github.com/serp-ai/bark-with-voice-clone.git
synced 2025-12-15 19:27:57 +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
|
I have a silky smooth voice, and today I will tell you about
|
||||||
the exercise regimen of the common sloth.
|
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)
|
[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
|
SAMPLE_RATE = 24_000
|
||||||
|
|
||||||
|
|
||||||
ALLOWED_PROMPTS = (
|
ALLOWED_PROMPTS = set(
|
||||||
"brylcream",
|
[f"speech_{n}" for n in range(8)] +
|
||||||
"es-woman",
|
[f"music_{n}" for n in range(6)]
|
||||||
"man-narrator",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -307,7 +306,7 @@ def generate_text_semantic(
|
|||||||
assert (history_prompt in ALLOWED_PROMPTS)
|
assert (history_prompt in ALLOWED_PROMPTS)
|
||||||
semantic_history = np.load(
|
semantic_history = np.load(
|
||||||
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
||||||
)["text"]
|
)["semantic_prompt"]
|
||||||
assert (
|
assert (
|
||||||
isinstance(semantic_history, np.ndarray)
|
isinstance(semantic_history, np.ndarray)
|
||||||
and len(semantic_history.shape) == 1
|
and len(semantic_history.shape) == 1
|
||||||
@@ -452,8 +451,8 @@ def generate_coarse(
|
|||||||
x_history = np.load(
|
x_history = np.load(
|
||||||
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
||||||
)
|
)
|
||||||
x_semantic_history = x_history["coarse_1"]
|
x_semantic_history = x_history["semantic_prompt"]
|
||||||
x_coarse_history = x_history["coarse_2"]
|
x_coarse_history = x_history["coarse_prompt"]
|
||||||
assert (
|
assert (
|
||||||
isinstance(x_semantic_history, np.ndarray)
|
isinstance(x_semantic_history, np.ndarray)
|
||||||
and len(x_semantic_history.shape) == 1
|
and len(x_semantic_history.shape) == 1
|
||||||
@@ -594,7 +593,7 @@ def generate_fine(
|
|||||||
assert (history_prompt in ALLOWED_PROMPTS)
|
assert (history_prompt in ALLOWED_PROMPTS)
|
||||||
x_fine_history = np.load(
|
x_fine_history = np.load(
|
||||||
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
os.path.join(CUR_PATH, "assets", "prompts", f"{history_prompt}.npz")
|
||||||
)["fine"]
|
)["fine_prompt"]
|
||||||
assert (
|
assert (
|
||||||
isinstance(x_fine_history, np.ndarray)
|
isinstance(x_fine_history, np.ndarray)
|
||||||
and len(x_fine_history.shape) == 2
|
and len(x_fine_history.shape) == 2
|
||||||
|
|||||||
Reference in New Issue
Block a user