Closed Zapzatron closed 1 year ago
It depends on the code you are running.
def vosk_run(file, language, model_size):
small_model_path = "models/vosk-model-small-ru-0.22"
big_model_path = "models/vosk-model-ru-0.42"
if model_size == "small":
last_path = small_model_path
elif model_size == "big":
last_path = big_model_path
else:
print("Invalid model size")
return
print(f"vosk_{model_size}_{language}")
# logging NOTSET
vosk_text = subprocess.run(["vosk-transcriber", "--model", last_path, "-i", file, "-l", language],
encoding="utf-8", capture_output=True, text=True)
print(vosk_text.stdout.split("\n")[0])
There is a lot of text in this code in vosk_text.stderr, how do I disable its creation?
You'd better use vosk api directly instead of vosk-transcriber.
How can I use this?
See example file here:
https://github.com/alphacep/vosk-api/blob/master/python/example/test_ffmpeg.py
How can I disable these logs?
vosk.SetLogLevel(-1) disabled logs
How can I disable output to the console? I only need the full generated text in the output without intermediate text.