zhaoyingjun / chatbot

ChatGPT带火了聊天机器人,主流的趋势都调整到了GPT类模式,本项目也与时俱进,会在近期更新GPT类版本。基于本项目和自己的语料可以训练出自己想要的聊天机器人,用于智能客服、在线问答、闲聊等场景。
3.51k stars 1.02k forks source link

rev_vocab always out of range? #29

Closed yzho0907 closed 5 years ago

yzho0907 commented 5 years ago

File "execute.py", line 338, in main gen_disc() File "execute.py", line 53, in gen_disc gens.decoder(gen_config) File "/home/bigdata/Leo/seqGanChatbot/gen/generator.py", line 266, in decoder answer_str = " ".join([str(rev_vocab[an]) for an in answer[:-1]]) File "/home/bigdata/Leo/seqGanChatbot/gen/generator.py", line 266, in answer_str = " ".join([str(rev_vocab[an]) for an in answer[:-1]]) IndexError: list index out of range any clue to fix it? thx

zhaoyingjun commented 5 years ago

'an' is out of the len(rev_vocab),you can print the len(rev_vocab) and an