mirror of
https://github.com/serp-ai/bark-with-voice-clone.git
synced 2025-12-15 19:27:57 +01:00
QoL updates
This commit is contained in:
@@ -119,11 +119,30 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from bark.api import generate_audio\n",
|
"from bark.api import generate_audio\n",
|
||||||
"from bark.generation import SAMPLE_RATE\n",
|
"from bark.generation import SAMPLE_RATE, preload_models, codec_decode, generate_coarse, generate_fine, generate_text_semantic\n",
|
||||||
"text_prompt = \"Hello, my name is Suno. And, uh — and I like pizza. [laughs]\"\n",
|
"text_prompt = \"Hello, my name is Suno. And, uh — and I like pizza. [laughs]\"\n",
|
||||||
"voice_name = \"speaker_0\" # use your custom voice name here if you have one"
|
"voice_name = \"speaker_0\" # use your custom voice name here if you have one"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"# download and load all models\n",
|
||||||
|
"preload_models(\n",
|
||||||
|
" text_use_gpu=True,\n",
|
||||||
|
" text_use_small=False,\n",
|
||||||
|
" coarse_use_gpu=True,\n",
|
||||||
|
" coarse_use_small=False,\n",
|
||||||
|
" fine_use_gpu=True,\n",
|
||||||
|
" fine_use_small=False,\n",
|
||||||
|
" codec_use_gpu=True,\n",
|
||||||
|
" force_reload=False\n",
|
||||||
|
")"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@@ -141,7 +160,6 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# generation with more control\n",
|
"# generation with more control\n",
|
||||||
"from bark.generation import codec_decode, generate_coarse, generate_fine, generate_text_semantic\n",
|
|
||||||
"x_semantic = generate_text_semantic(\n",
|
"x_semantic = generate_text_semantic(\n",
|
||||||
" text_prompt,\n",
|
" text_prompt,\n",
|
||||||
" history_prompt=voice_name,\n",
|
" history_prompt=voice_name,\n",
|
||||||
|
|||||||
@@ -7,11 +7,30 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from bark.api import generate_audio\n",
|
"from bark.api import generate_audio\n",
|
||||||
"from bark.generation import SAMPLE_RATE\n",
|
"from bark.generation import SAMPLE_RATE, preload_models, codec_decode, generate_coarse, generate_fine, generate_text_semantic\n",
|
||||||
"text_prompt = \"Hello, my name is Suno. And, uh — and I like pizza. [laughs]\"\n",
|
"text_prompt = \"Hello, my name is Suno. And, uh — and I like pizza. [laughs]\"\n",
|
||||||
"voice_name = \"speaker_0\" # use your custom voice name here if you have one"
|
"voice_name = \"speaker_0\" # use your custom voice name here if you have one"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"# download and load all models\n",
|
||||||
|
"preload_models(\n",
|
||||||
|
" text_use_gpu=True,\n",
|
||||||
|
" text_use_small=False,\n",
|
||||||
|
" coarse_use_gpu=True,\n",
|
||||||
|
" coarse_use_small=False,\n",
|
||||||
|
" fine_use_gpu=True,\n",
|
||||||
|
" fine_use_small=False,\n",
|
||||||
|
" codec_use_gpu=True,\n",
|
||||||
|
" force_reload=False\n",
|
||||||
|
")"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@@ -29,7 +48,6 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# generation with more control\n",
|
"# generation with more control\n",
|
||||||
"from bark.generation import codec_decode, generate_coarse, generate_fine, generate_text_semantic\n",
|
|
||||||
"x_semantic = generate_text_semantic(\n",
|
"x_semantic = generate_text_semantic(\n",
|
||||||
" text_prompt,\n",
|
" text_prompt,\n",
|
||||||
" history_prompt=voice_name,\n",
|
" history_prompt=voice_name,\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user