vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Runtime printed these warnings: CheckMemoryUsage() ... Rebuilding repository

Open zxl777 opened this issue 2 years ago • 4 comments

vosk 0.3.37 Do I need to deal with this WARNING ?

LOG (VoskAPI:RebuildRepository():determinize-lattice-pruned.cc:283) Rebuilding repository.
LOG (VoskAPI:RebuildRepository():determinize-lattice-pruned.cc:283) Rebuilding repository.
LOG (VoskAPI:RebuildRepository():determinize-lattice-pruned.cc:283) Rebuilding repository.
WARNING (VoskAPI:CheckMemoryUsage():determinize-lattice-pruned.cc:316) Did not reach requested beam in determinize-lattice: size exceeds maximum 50000000 bytes; (repo,arcs,elems) = (20747456,2102464,27156216), after rebuilding, repo size was 13385536, effective beam was 5.8168 vs. requested beam 6
LOG (VoskAPI:RebuildRepository():determinize-lattice-pruned.cc:283) Rebuilding repository.

zxl777 avatar Apr 14 '22 09:04 zxl777

How to reproduce them?

nshmyrev avatar Apr 14 '22 09:04 nshmyrev

audio: https://transfer.sh/Oax5b2/temp.wav

model: https://alphacephei.com/vosk/models/vosk-model-en-us-0.22.zip

        wf = wave.open(f"temp.wav", "rb")
        if (
            wf.getnchannels() != 1
            or wf.getsampwidth() != 2
            or wf.getcomptype() != "NONE"
        ):
            print("Audio file must be WAV format mono PCM.")
            exit(1)

        model = Model("model")
        rec = KaldiRecognizer(model, wf.getframerate())
        rec.SetWords(True)

        result = []
        text = ""

        while True:
            data = wf.readframes(4000)
            if len(data) == 0:
                break
            if rec.AcceptWaveform(data):
                print(f"rec.Result() = {rec.Result()}")
            else:
                print(rec.PartialResult())
                pass

zxl777 avatar Apr 14 '22 10:04 zxl777

You can ignore these warnings from now, they are from large pieces of music in your recording. We might work on such audios in the future, for now it is just a warning.

nshmyrev avatar Apr 14 '22 10:04 nshmyrev

Thank you, the accuracy and speed of VOSK are very good.

zxl777 avatar Apr 14 '22 10:04 zxl777

Same issue as #1127

nshmyrev avatar Aug 31 '22 20:08 nshmyrev