mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
add a initializer
This commit is contained in:
@@ -77,7 +77,7 @@
|
|||||||
" wav = read_audio(audio_file, sampling_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",
|
" vad_model,\n",
|
||||||
" 0.46, # speech prob threshold\n",
|
" 0.46, # speech prob threshold\n",
|
||||||
" 16000, # sample rate\n",
|
" 16000, # sample rate\n",
|
||||||
" 300, # min speech duration in ms\n",
|
" 300, # min speech duration in ms\n",
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
"futures = []\n",
|
"futures = []\n",
|
||||||
"NUM_COPIES=20\n",
|
"NUM_COPIES=20\n",
|
||||||
"\n",
|
"\n",
|
||||||
"with ProcessPoolExecutor(max_workers=NUM_PROCESS) as ex:\n",
|
"with ProcessPoolExecutor(max_workers=NUM_PROCESS, initializer=init_model, initargs=(model,)) as ex:\n",
|
||||||
" for i in range(NUM_COPIES):\n",
|
" for i in range(NUM_COPIES):\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",
|
||||||
|
|||||||
Reference in New Issue
Block a user