You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
以下代码中:
`
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))
以下代码中:
`
elif not hotword_list_or_file.endswith(".txt"):
`
hw_list = hw.strip().split()导致hw转为list后,tokens2ids只能获取错误的token,shape也成了(1,)
需要改为 hotword_list.append(tokenizer.tokens2ids(hw_list[0]))
The text was updated successfully, but these errors were encountered: