mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
fix typos
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
"from pprint import pprint\n",
|
"from pprint import pprint\n",
|
||||||
"torch.set_num_threads(1)\n",
|
"torch.set_num_threads(1)\n",
|
||||||
"# download wav files, make multiple copies\n",
|
"# download wav files, make multiple copies\n",
|
||||||
"for idx in range(10):\n",
|
"for idx in range(4):\n",
|
||||||
" torch.hub.download_url_to_file('https://models.silero.ai/vad_models/en.wav', f\"en_example{idx}.wav\")\n"
|
" torch.hub.download_url_to_file('https://models.silero.ai/vad_models/en.wav', f\"en_example{idx}.wav\")\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',\n",
|
"model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',\n",
|
||||||
" model='silero_vad',\n",
|
" model='silero_vad',\n",
|
||||||
" force_reload=True,\n",
|
" force_reload=True,\n",
|
||||||
" onnx=USE_ONNX)\n",
|
" onnx=False)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"(get_speech_timestamps,\n",
|
"(get_speech_timestamps,\n",
|
||||||
" save_audio,\n",
|
" save_audio,\n",
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"def vad_process(audio_file: str):\n",
|
"def vad_process(audio_file: str):\n",
|
||||||
" with torch.no_grad():\n",
|
" with torch.no_grad():\n",
|
||||||
" wav = read_audio(audio_file, sample_rate=SAMPLING_RATE)\n",
|
" wav = read_audio(audio_file, sampling_rate=SAMPLING_RATE)\n",
|
||||||
" return get_speech_timestamps(\n",
|
" return get_speech_timestamps(\n",
|
||||||
" wav,\n",
|
" wav,\n",
|
||||||
" model,\n",
|
" model,\n",
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"futures = []\n",
|
"futures = []\n",
|
||||||
"with ProcessPoolExecutor(max_workers=4) as ex:\n",
|
"with ProcessPoolExecutor(max_workers=4) as ex:\n",
|
||||||
" for i in range(10):\n",
|
" for i in range(4):\n",
|
||||||
" futures.append(ex.submit(vad_process, f\"en_example{idx}.wav\"))\n",
|
" futures.append(ex.submit(vad_process, f\"en_example{idx}.wav\"))\n",
|
||||||
"\n",
|
"\n",
|
||||||
"for finished in as_completed(futures):\n",
|
"for finished in as_completed(futures):\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user