Update basic_training_notebook.ipynb

This commit is contained in:
MasterPhooey
2025-01-02 23:10:57 -06:00
committed by GitHub
parent a5d3307d8c
commit e603d2e5fb

View File

@@ -29,16 +29,28 @@
"source": [
"# Installs microWakeWord. Be sure to restart the session after this is finished.\n",
"import platform\n",
"import sys\n",
"import os\n",
"\n",
"if platform.system() == \"Darwin\":\n",
" # `pymicro-features` is installed from a fork to support building on macOS\n",
" !{sys.executable} pip install 'git+https://github.com/puddly/pymicro-features@puddly/minimum-cpp-version'\n",
" !\"{sys.executable}\" -m pip install 'git+https://github.com/puddly/pymicro-features@puddly/minimum-cpp-version'\n",
"\n",
"# `audio-metadata` is installed from a fork to unpin `attrs` from a version that breaks Jupyter\n",
"!{sys.executable} pip install 'git+https://github.com/whatsnowplaying/audio-metadata@d4ebb238e6a401bb1a5aaaac60c9e2b3cb30929f'\n",
"!\"{sys.executable}\" -m pip install 'git+https://github.com/whatsnowplaying/audio-metadata@d4ebb238e6a401bb1a5aaaac60c9e2b3cb30929f'\n",
"\n",
"!git clone -b https://github.com/kahrendt/microWakeWord\n",
"!{sys.executable} pip install -e ./microWakeWord"
"# Clone the microWakeWord repository\n",
"repo_path = \"./microWakeWord\"\n",
"if not os.path.exists(repo_path):\n",
" print(\"Cloning microWakeWord repository...\")\n",
" !git clone https://github.com/kahrendt/microWakeWord.git {repo_path}\n",
"\n",
"# Ensure the repository exists before attempting to install\n",
"if os.path.exists(repo_path):\n",
" print(\"Installing microWakeWord...\")\n",
" !\"{sys.executable}\" -m pip install -e {repo_path}\n",
"else:\n",
" print(f\"Repository not found at {repo_path}. Cloning might have failed.\")"
]
},
{
@@ -59,21 +71,21 @@
"\n",
"from IPython.display import Audio\n",
"\n",
"if not os.path.exists(\"./piper-sample-generator\"):\n",
"if not os.path.exists(\"./-m piper-sample-generator\"):\n",
" if platform.system() == \"Darwin\":\n",
" !git clone -b mps-support https://github.com/kahrendt/piper-sample-generator\n",
" else:\n",
" !git clone https://github.com/rhasspy/piper-sample-generator\n",
"\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",
" !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",
"\n",
" # Install system dependencies\n",
" !{sys.executable} pip install torch torchaudio piper-phonemize-cross==1.2.1\n",
" !\"{sys.executable}\" -m pip install torch torchaudio -m piper-phonemize-cross==1.2.1\n",
"\n",
" if \"piper-sample-generator/\" not in sys.path:\n",
" sys.path.append(\"piper-sample-generator/\")\n",
" if \"-m piper-sample-generator/\" not in sys.path:\n",
" sys.path.append(\"-m piper-sample-generator/\")\n",
"\n",
"!{sys.executable} pyrhon3 piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
"!\"{sys.executable}\" pyrhon3 -m piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
"--max-samples 1 \\\n",
"--batch-size 1 \\\n",
"--output-dir generated_samples\n",
@@ -91,12 +103,12 @@
"source": [
"# Generates a larger amount of wake word samples.\n",
"# Start here when trying to improve your model.\n",
"# See https://github.com/rhasspy/piper-sample-generator for the full set of\n",
"# See https://github.com/rhasspy/-m piper-sample-generator for the full set of\n",
"# parameters. In particular, experiment with noise-scales and noise-scale-ws,\n",
"# generating negative samples similar to the wake word, and generating many more\n",
"# wake word samples, possibly with different phonetic pronunciations.\n",
"\n",
"!{sys.executable} pyrhon3 piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
"!\"{sys.executable}\" pyrhon3 -m piper-sample-generator/generate_samples.py \"{target_word}\" \\\n",
"--max-samples 1000 \\\n",
"--batch-size 100 \\\n",
"--output-dir generated_samples"