Update advanced_training_notebook.ipynb

This commit is contained in:
MasterPhooey
2025-01-05 09:04:58 -06:00
committed by GitHub
parent 6dc57f201b
commit ece7219f4f

View File

@@ -156,6 +156,7 @@
"from datasets import load_dataset\n", "from datasets import load_dataset\n",
"\n", "\n",
"# Function to download and process RIR dataset\n", "# Function to download and process RIR dataset\n",
"# Function to download and process RIR dataset\n",
"def download_rir_dataset(dataset_name, output_dir, split=\"train\"):\n", "def download_rir_dataset(dataset_name, output_dir, split=\"train\"):\n",
" output_dir = Path(output_dir)\n", " output_dir = Path(output_dir)\n",
" if not output_dir.exists():\n", " if not output_dir.exists():\n",
@@ -165,11 +166,9 @@
" print(f\"Downloading {dataset_name} to {output_dir}...\")\n", " print(f\"Downloading {dataset_name} to {output_dir}...\")\n",
" for row in tqdm(rir_dataset):\n", " for row in tqdm(rir_dataset):\n",
" name = Path(row['audio']['path']).name\n", " name = Path(row['audio']['path']).name\n",
" scipy.io.wavfile.write(\n", " # Save the original audio file\n",
" output_dir / name,\n", " with open(output_dir / name, \"wb\") as audio_file:\n",
" 16000,\n", " audio_file.write(row[\"audio\"][\"bytes\"])\n",
" (row['audio']['array'] * 32767).astype(np.int16)\n",
" )\n",
" print(f\"Finished downloading {dataset_name} to {output_dir}.\\n\")\n", " print(f\"Finished downloading {dataset_name} to {output_dir}.\\n\")\n",
" except Exception as e:\n", " except Exception as e:\n",
" print(f\"Error downloading {dataset_name}: {e}\")\n", " print(f\"Error downloading {dataset_name}: {e}\")\n",
@@ -713,7 +712,7 @@
"# Define the JSON metadata for the model\n", "# Define the JSON metadata for the model\n",
"json_data = {\n", "json_data = {\n",
" \"type\": \"micro\",\n", " \"type\": \"micro\",\n",
" \"wake_word\": \"hey_norman\", # Adjust based on your target wake word\n", " \"wake_word\": \"khum_puter\", # Adjust based on your target wake word\n",
" \"author\": \"master phooey\",\n", " \"author\": \"master phooey\",\n",
" \"website\": \"https://github.com/MasterPhooey/MicroWakeWord-Trainer-Docker\",\n", " \"website\": \"https://github.com/MasterPhooey/MicroWakeWord-Trainer-Docker\",\n",
" \"model\": \"stream_state_internal_quant.tflite\",\n", " \"model\": \"stream_state_internal_quant.tflite\",\n",