Files
Mohammad Hijjawi 8f8931dc9a fix(paraformer): skip blank lines and read hotword files as UTF-8 (#3761)
SeACo-Paraformer and Contextual Paraformer turn every line of a hotword
.txt file into a hotword. A blank line (e.g. an extra newline at the end
of the file) became an empty hotword, and its zero length made
pack_padded_sequence raise "Length of all samples has to be greater
than 0" in the bias encoder, so inference failed.

The file was also opened with codecs.open() without an encoding, i.e.
the locale encoding. On Windows a UTF-8 Chinese hotword file decoded
into mojibake, so every hotword became <unk> (or reading raised
UnicodeDecodeError on GBK locales).

Read the local and downloaded hotword files as UTF-8 and skip blank
lines, matching parse_hotword_file() in funasr/utils/postprocess_hotwords.py.
2026-10-08 14:09:17 +08:00
..
2023-12-27 17:16:07 +08:00