mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-04 17:39: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",
|
||||
" return get_speech_timestamps(\n",
|
||||
" wav,\n",
|
||||
" model,\n",
|
||||
" vad_model,\n",
|
||||
" 0.46, # speech prob threshold\n",
|
||||
" 16000, # sample rate\n",
|
||||
" 300, # min speech duration in ms\n",
|
||||
@@ -107,7 +107,7 @@
|
||||
"futures = []\n",
|
||||
"NUM_COPIES=20\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",
|
||||
" futures.append(ex.submit(vad_process, f\"en_example{idx}.wav\"))\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user