Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SeacoParaformer的generate_hotwords_list函数有问题,导致hotword无法使用 #2443

Open
darcyOly999 opened this issue Mar 20, 2025 · 0 comments
Labels
question Further information is requested

Comments

@darcyOly999
Copy link

darcyOly999 commented Mar 20, 2025

以下代码中:
`
elif not hotword_list_or_file.endswith(".txt"):

        logging.info("Attempting to parse hotwords as str...")

        hotword_list = []

        hotword_str_list = []

        for hw in hotword_list_or_file.strip().split():

            hotword_str_list.append(hw)

            hw_list = hw.strip().split()

            if seg_dict is not None:

                hw_list = seg_tokenize(hw_list, seg_dict)

            hotword_list.append(tokenizer.tokens2ids(hw_list))

        hotword_list.append([self.sos])

        hotword_str_list.append("<s>")

        logging.info("Hotword list: {}.".format(hotword_str_list))

`

hw_list = hw.strip().split()导致hw转为list后,tokens2ids只能获取错误的token,shape也成了(1,)
需要改为 hotword_list.append(tokenizer.tokens2ids(hw_list[0]))

@darcyOly999 darcyOly999 added the question Further information is requested label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant