Python doesn't find model in folder at Model(model_name="models/model-en-0.2) If Model(model_name="model-en-0.2)is writen then it works.How to fix it?
Question:
Python doesn’t find the vosk model in the folder at Model(model_name="libs/models/vosk-model-small-en-0.22").
from vosk import Model, KaldiRecognizer
FRAME_RATE = 16000
CHANNELS=1
model = Model(model_name="libs/models/vosk-model-small-en-0.22") #The model is in this folder.
rec = KaldiRecognizer(model, FRAME_RATE)
rec.SetWords(True)
this cell throws an error: "Exception: model name libs/models/vosk-model-small-en-0.22 does not exist"
If you put the "vosk-model-small-en-0.22" model folder on the same level as the python script and write:
FRAME_RATE = 16000
CHANNELS=1
model = Model(model_name="vosk-model-small-en-0.22")
rec = KaldiRecognizer(model, FRAME_RATE)
rec.SetWords(True)
then everything works.
I will use several models for different languages, it is convenient for me that they lie in the model / libs. How do I write the address in model_name so that everything works?
Answers:
I found out that the model should be located at C:Users User .cachevoskvosk-model-en-0.22
Python doesn’t find the vosk model in the folder at Model(model_name="libs/models/vosk-model-small-en-0.22").
from vosk import Model, KaldiRecognizer
FRAME_RATE = 16000
CHANNELS=1
model = Model(model_name="libs/models/vosk-model-small-en-0.22") #The model is in this folder.
rec = KaldiRecognizer(model, FRAME_RATE)
rec.SetWords(True)
this cell throws an error: "Exception: model name libs/models/vosk-model-small-en-0.22 does not exist"
If you put the "vosk-model-small-en-0.22" model folder on the same level as the python script and write:
FRAME_RATE = 16000
CHANNELS=1
model = Model(model_name="vosk-model-small-en-0.22")
rec = KaldiRecognizer(model, FRAME_RATE)
rec.SetWords(True)
then everything works.
I will use several models for different languages, it is convenient for me that they lie in the model / libs. How do I write the address in model_name so that everything works?
I found out that the model should be located at C:Users User .cachevoskvosk-model-en-0.22