mirror of
https://github.com/TaterTotterson/microWakeWord-Trainer-Nvidia-Docker.git
synced 2026-06-12 20:10:19 -06:00
Update advanced_training_notebook.ipynb
This commit is contained in:
@@ -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,17 +166,15 @@
|
|||||||
" 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",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" print(f\"{output_dir} already exists. Skipping download.\\n\")\n",
|
" print(f\"{output_dir} already exists. Skipping download.\\n\")\n",
|
||||||
"\n",
|
" \n",
|
||||||
"# Download MIT RIRs\n",
|
"# Download MIT RIRs\n",
|
||||||
"download_rir_dataset(\n",
|
"download_rir_dataset(\n",
|
||||||
" \"davidscripka/MIT_environmental_impulse_responses\",\n",
|
" \"davidscripka/MIT_environmental_impulse_responses\",\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",
|
||||||
|
|||||||
Reference in New Issue
Block a user