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:
@@ -20,27 +20,39 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "BFf6511E65ff"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Installs microWakeWord. Be sure to restart the session after this is finished.\n",
|
||||
"import platform\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",
|
||||
"\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",
|
||||
"\n",
|
||||
"!git clone -b https://github.com/kahrendt/microWakeWord\n",
|
||||
"!{sys.executable} pip install -e ./microWakeWord"
|
||||
]
|
||||
},
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "BFf6511E65ff"
|
||||
},
|
||||
"outputs": [],
|
||||
"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}\" -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}\" -m pip install 'git+https://github.com/whatsnowplaying/audio-metadata@d4ebb238e6a401bb1a5aaaac60c9e2b3cb30929f'\n",
|
||||
"\n",
|
||||
"# 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.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -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"
|
||||
@@ -557,4 +569,4 @@
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user