Skip to content

Vosk model vosk-model-pt-fb-v0.1.1-20220516_2113 throwing error: ConstArpaLm <LmStates> section reading failed. #1361

Description

@heiytor

I am currently encountering an issue with the Vosk model vosk-model-pt-fb-v0.1.1-20220516_2113, which can be found at this link.

While attempting to use this model, I receive the following error:

ERROR (VoskAPI:ReadInternal():const-arpa-lm.cc:610) ConstArpaLm <LmStates
> section reading failed.

To address this issue, I referred to Issue #1028 and tried reinstalling the model, which did not resolve the error. I also tried cloning directly from the source, but this also resulted in the same error.

Below is the full output:

LOG (VoskAPI:ReadDataFiles():model.cc:213) Decoding params beam=10 max-ac
tive=7000 lattice-beam=6
LOG (VoskAPI:ReadDataFiles():model.cc:216) Silence phones 1:2:3:4:5:6:7:8
:9:10
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes
.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan
 components.
LOG (VoskAPI:ReadDataFiles():model.cc:248) Loading i-vector extractor fro
m D:\presicion-data\vosk-api\vosk-model-pt-fb-v0.1.1-20220516_2113/ivecto
r/final.ie
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing der
ived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.        
LOG (VoskAPI:ReadDataFiles():model.cc:279) Loading HCLG from D:\presicion
-data\vosk-api\vosk-model-pt-fb-v0.1.1-20220516_2113/graph/HCLG.fst      
LOG (VoskAPI:ReadDataFiles():model.cc:294) Loading words from D:\presicio
n-data\vosk-api\vosk-model-pt-fb-v0.1.1-20220516_2113/graph/words.txt    
LOG (VoskAPI:ReadDataFiles():model.cc:303) Loading winfo D:\presicion-dat
a\vosk-api\vosk-model-pt-fb-v0.1.1-20220516_2113/graph/phones/word_bounda
ry.int
LOG (VoskAPI:ReadDataFiles():model.cc:310) Loading subtract G.fst model f
rom D:\presicion-data\vosk-api\vosk-model-pt-fb-v0.1.1-20220516_2113/resc
ore/G.fst
LOG (VoskAPI:ReadDataFiles():model.cc:312) Loading CARPA model from D:\pr
esicion-data\vosk-api\vosk-model-pt-fb-v0.1.1-20220516_2113/rescore/G.car
pa
ERROR (VoskAPI:ReadInternal():const-arpa-lm.cc:610) ConstArpaLm <LmStates
> section reading failed.

Additionally, I tested the vosk-model-pt-fb-v0.1.1-20220516_2113 model available here. However, the output indicated that my microphone was not recognized, as shown below:

$ node index.js 
LOG (VoskAPI:ReadDataFiles():model.cc:213) Decoding params beam=13 max-ac
tive=7000 lattice-beam=6
LOG (VoskAPI:ReadDataFiles():model.cc:216) Silence phones 1:2:3:4:5:6:7:8
:9:10
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 1 orphan nodes
.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 2 orphan
 components.
LOG (VoskAPI:Collapse():nnet-utils.cc:1488) Added 1 components, removed 2
LOG (VoskAPI:ReadDataFiles():model.cc:248) Loading i-vector extractor fro
m D:\presicion-data\vosk-api\vosk-model-small-pt-0.3/ivector/final.ie    
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing der
ived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.        
LOG (VoskAPI:ReadDataFiles():model.cc:282) Loading HCL and G from D:\pres
icion-data\vosk-api\vosk-model-small-pt-0.3/HCLr.fst D:\presicion-data\vo
sk-api\vosk-model-small-pt-0.3/Gr.fst
LOG (VoskAPI:ReadDataFiles():model.cc:303) Loading winfo D:\presicion-dat
a\vosk-api\vosk-model-small-pt-0.3/word_boundary.int
{ partial: '' }
{ partial: '' }
{ partial: '' }
{ partial: '' }
{ partial: '' }
{ text: '' }
{ partial: '' }
{ partial: '' }
{ partial: '' }
{ partial: '' }
{ text: '' }
{ partial: '' }

Stopping

I am currently using Windows 11, Sox 14.2.2, and Node.js 18.16.0. Below is the full code:

const path = require('path')
var vosk = require('vosk')
const fs = require("fs");
var mic = require("mic");

const MODEL_1 = path.resolve(__dirname, 'vosk-model-pt-fb-v0.1.1-20220516_2113');
const MODEL_2 = path.resolve(__dirname, 'vosk-model-small-pt-0.3')

SAMPLE_RATE = 16000

if (!fs.existsSync(MODEL_1)) {
    process.exit()
}

vosk.setLogLevel(0);
const model = new vosk.Model(MODEL_1);
const rec = new vosk.Recognizer({model: model, sampleRate: SAMPLE_RATE, frameSize: 4000});

var micInstance = mic({
    rate: String(SAMPLE_RATE),
    channels: '1',
    debug: false,
    device: 'default',    
});

var micInputStream = micInstance.getAudioStream();

micInputStream.on('data', data => {
    if (rec.acceptWaveform(data)) {
        console.log(rec.result());
    } else{
        console.log(rec.partialResult());
    }
});

micInputStream.on('audioProcessExitComplete', function() {
    console.log("Cleaning up");
    console.log(rec.finalResult());
    rec.free();
    model.free();
});

process.on('SIGINT', function() {
    console.log("\nStopping");
    micInstance.stop();
});

micInstance.start();

Any assistance in addressing this issue would be greatly appreciated.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions