This commit is contained in:
Tater Totterson
2025-11-02 09:53:03 -06:00
committed by GitHub
parent a78ccba056
commit efcf8a4add
2 changed files with 25 additions and 11 deletions

View File

@@ -44,25 +44,26 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"# Installs microWakeWord. Be sure to restart the session after this is finished.\n",
"import platform\n", "import platform\n",
"import sys\n", "import sys\n",
"import os\n", "import os\n",
"\n", "\n",
"# mac-only helper deps\n",
"if platform.system() == \"Darwin\":\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' --root-user-action=ignore\n", " !\"{sys.executable}\" -m pip install 'git+https://github.com/puddly/pymicro-features@puddly/minimum-cpp-version' --root-user-action=ignore\n",
"\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' --root-user-action=ignore\n", "!\"{sys.executable}\" -m pip install 'git+https://github.com/whatsnowplaying/audio-metadata@d4ebb238e6a401bb1a5aaaac60c9e2b3cb30929f' --root-user-action=ignore\n",
"\n", "\n",
"# Clone the microWakeWord repository (your fork)\n", "# 👇 use the actual location in the container\n",
"repo_path = \"./microWakeWord\"\n", "repo_path = \"/data/microWakeWord\"\n",
"\n",
"if not os.path.exists(repo_path):\n", "if not os.path.exists(repo_path):\n",
" print(\"⬇️ Cloning microWakeWord repository...\")\n", " print(\"⬇️ Cloning microWakeWord repository to /data…\")\n",
" !git clone https://github.com/TaterTotterson/micro-wake-word.git {repo_path}\n", " !git clone https://github.com/TaterTotterson/micro-wake-word.git {repo_path}\n",
"\n", "\n",
"# Install editable\n", "# optional: pin to a commit\n",
"# !cd /data/microWakeWord && git checkout ac6502bf48b5e372c47ed509f5f5ca181e6d50bb\n",
"\n",
"if os.path.exists(repo_path):\n", "if os.path.exists(repo_path):\n",
" print(\"📦 Installing microWakeWord...\")\n", " print(\"📦 Installing microWakeWord...\")\n",
" !\"{sys.executable}\" -m pip install -e {repo_path} --root-user-action=ignore\n", " !\"{sys.executable}\" -m pip install -e {repo_path} --root-user-action=ignore\n",
@@ -454,8 +455,24 @@
"# Sets up the augmentations.\n", "# Sets up the augmentations.\n",
"# To improve your model, experiment with these settings and use more sources of\n", "# To improve your model, experiment with these settings and use more sources of\n",
"# background clips.\n", "# background clips.\n",
"import sys, os\n",
"\n", "\n",
"import os\n", "# try the common places weve used\n",
"candidates = [\n",
" \"/data/microWakeWord\", # what the last install log showed\n",
" \"/data/microwakeword\", # lowercase variant\n",
" \"./microwakeword\", # local clone\n",
" \"./microWakeWord\", # camel case\n",
"]\n",
"\n",
"for base in candidates:\n",
" if os.path.isdir(base):\n",
" # add the repo root\n",
" sys.path.insert(0, base)\n",
" # add the actual package dir inside the repo\n",
" if os.path.isdir(os.path.join(base, \"microwakeword\")):\n",
" sys.path.insert(0, os.path.join(base, \"microwakeword\"))\n",
" break\n",
"from microwakeword.audio.augmentation import Augmentation\n", "from microwakeword.audio.augmentation import Augmentation\n",
"from microwakeword.audio.clips import Clips\n", "from microwakeword.audio.clips import Clips\n",
"from microwakeword.audio.spectrograms import SpectrogramGeneration\n", "from microwakeword.audio.spectrograms import SpectrogramGeneration\n",

View File

@@ -36,6 +36,3 @@ jupyterlab==4.3.4
ipywidgets==8.1.5 ipywidgets==8.1.5
matplotlib-inline==0.1.7 matplotlib-inline==0.1.7
rich==13.9.4 rich==13.9.4
# --- microWakeWord ---
-e git+https://github.com/kahrendt/microWakeWord@ac6502bf48b5e372c47ed509f5f5ca181e6d50bb#egg=microwakeword