mirror of
https://github.com/TaterTotterson/microWakeWord-Trainer-Nvidia-Docker.git
synced 2026-06-12 20:10:19 -06:00
Update basic_training_notebook.ipynb
This commit is contained in:
@@ -71,26 +71,36 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"from IPython.display import Audio\n",
|
"from IPython.display import Audio\n",
|
||||||
"\n",
|
"\n",
|
||||||
"if not os.path.exists(\"./-m piper-sample-generator\"):\n",
|
"# Ensure the repository is cloned correctly\n",
|
||||||
|
"if not os.path.exists(\"./piper-sample-generator\"):\n",
|
||||||
" if platform.system() == \"Darwin\":\n",
|
" if platform.system() == \"Darwin\":\n",
|
||||||
" !git clone -b mps-support https://github.com/kahrendt/piper-sample-generator\n",
|
" !git clone -b mps-support https://github.com/kahrendt/piper-sample-generator\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" !git clone https://github.com/rhasspy/piper-sample-generator\n",
|
" !git clone https://github.com/rhasspy/piper-sample-generator\n",
|
||||||
"\n",
|
"\n",
|
||||||
" !wget -O -m piper-sample-generator/models/en_US-libritts_r-medium.pt 'https://github.com/rhasspy/-m piper-sample-generator/releases/download/v2.0.0/en_US-libritts_r-medium.pt'\n",
|
"# Download the required model\n",
|
||||||
|
"if not os.path.exists(\"piper-sample-generator/models/en_US-libritts_r-medium.pt\"):\n",
|
||||||
|
" !wget -O piper-sample-generator/models/en_US-libritts_r-medium.pt 'https://github.com/rhasspy/piper-sample-generator/releases/download/v2.0.0/en_US-libritts_r-medium.pt'\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # Install system dependencies\n",
|
"# Install system dependencies\n",
|
||||||
" !\"{sys.executable}\" -m pip install torch torchaudio -m piper-phonemize-cross==1.2.1\n",
|
"!\"{sys.executable}\" -m pip install torch torchaudio piper-phonemize-cross==1.2.1\n",
|
||||||
"\n",
|
"\n",
|
||||||
" if \"-m piper-sample-generator/\" not in sys.path:\n",
|
"# Ensure the repository path is in sys.path\n",
|
||||||
" sys.path.append(\"-m piper-sample-generator/\")\n",
|
"if \"piper-sample-generator/\" not in sys.path:\n",
|
||||||
|
" sys.path.append(\"piper-sample-generator/\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"!\"{sys.executable}\" pyrhon3 -m piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
|
"# Generate sample\n",
|
||||||
|
"!\"{sys.executable}\" piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
|
||||||
"--max-samples 1 \\\n",
|
"--max-samples 1 \\\n",
|
||||||
"--batch-size 1 \\\n",
|
"--batch-size 1 \\\n",
|
||||||
"--output-dir generated_samples\n",
|
"--output-dir generated_samples\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Audio(\"generated_samples/0.wav\", autoplay=True)"
|
"# Play the generated audio sample\n",
|
||||||
|
"audio_path = \"generated_samples/0.wav\"\n",
|
||||||
|
"if os.path.exists(audio_path):\n",
|
||||||
|
" display(Audio(audio_path, autoplay=True))\n",
|
||||||
|
"else:\n",
|
||||||
|
" print(f\"Audio file not found at {audio_path}\")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -108,7 +118,7 @@
|
|||||||
"# generating negative samples similar to the wake word, and generating many more\n",
|
"# generating negative samples similar to the wake word, and generating many more\n",
|
||||||
"# wake word samples, possibly with different phonetic pronunciations.\n",
|
"# wake word samples, possibly with different phonetic pronunciations.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"!\"{sys.executable}\" pyrhon3 -m piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
|
"!\"{sys.executable}\" -m piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
|
||||||
"--max-samples 1000 \\\n",
|
"--max-samples 1000 \\\n",
|
||||||
"--batch-size 100 \\\n",
|
"--batch-size 100 \\\n",
|
||||||
"--output-dir generated_samples"
|
"--output-dir generated_samples"
|
||||||
|
|||||||
Reference in New Issue
Block a user