-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
silero-models and silero-vad combined lead to ImportError #28
Comments
Can you please post a code snippet? |
It seems to be related to local cache and torch.hub.load() when loading both models in the same subprocess. Quoting PyTorch documentation: https://pytorch.org/docs/stable/hub.html Current implementation: -> function 1 def _speech_to_timestamps(filepath):
-> function 2 def _speech_to_text(filepath, language):
Currently trying to implement the second call into a new subprocess as a workaround. |
Hm, interesting, I suppose repos are different but the name is the same, that's why it has a problem (I believe it can be checked by following torch hub cache paths)? I will verify a bit later, but some plain solutions out of my head:
|
Alright, thank you |
It pulls repos into different folders for sure
|
So, I believe I am narrowing on the culprit
but this cannot
Using |
Found the culprit, looks like all This minimal example solves the problem
|
After a small fix in the
Also please note that architecture-wise VAD is fast enough to operate on 1 thread, while STT is not. |
Please confirm the fix and close |
You are correct, it does work now. |
If using both silero-models and silero-vad combined in a function call, only either the models or vad call works, while the second leads to an ImportError:
ImportError: cannot import name 'get_speech_ts'
I assume not being aware of something trivial here, but couldn't figure out how to solve this until now. Any ideas?
The text was updated successfully, but these errors were encountered: