使用fastchat加载百川2,性能与魔搭的demo差距非常大

#10
by ye7love7 - opened

完全无法对齐,比如提问:请帮我阅读一下问题,找出地点和人物,用逗号分开,不要输出其他内容。自己部署的13b- chat还是会说其他内容,魔搭的不会,而且魔搭的还能按照要求直接输出字典,比自己fastchat部署的好太多了,这是怎么回事。

Baichuan Intelligent Technology org

完全无法对齐,比如提问:请帮我阅读一下问题,找出地点和人物,用逗号分开,不要输出其他内容。自己部署的13b- chat还是会说其他内容,魔搭的不会,而且魔搭的还能按照要求直接输出字典,比自己fastchat部署的好太多了,这是怎么回事。

你可以需要加上一些前缀和后缀,可以参考modeling_baichuan.py里的chat实现。

完全无法对齐,比如提问:请帮我阅读一下问题,找出地点和人物,用逗号分开,不要输出其他内容。自己部署的13b- chat还是会说其他内容,魔搭的不会,而且魔搭的还能按照要求直接输出字典,比自己fastchat部署的好太多了,这是怎么回事。

你可以需要加上一些前缀和后缀,可以参考modeling_baichuan.py里的chat实现。

感谢,比如加一些什么?

Baichuan Intelligent Technology org

你看一下_build_chat_input函数就知道了

Baichuan-13B-Chat template

register_conv_template(
# source: https://huggingface.co/baichuan-inc/Baichuan-13B-Chat/blob/19ef51ba5bad8935b03acd20ff04a269210983bc/modeling_baichuan.py#L555
# https://huggingface.co/baichuan-inc/Baichuan-13B-Chat/blob/main/generation_config.json
# https://github.com/baichuan-inc/Baichuan-13B/issues/25
Conversation(
name="baichuan-chat",
roles=("", ""),
sep_style=SeparatorStyle.NO_COLON_SINGLE,
sep="",
stop_token_ids=[],
)
)
我查看了_build_chat_input,以上是fastchat的源代码,上个月也有人提了问题,https://github.com/lm-sys/FastChat/blob/main/fastchat/conversation.py#L832

reference:baichuan-inc/Baichuan-13B#25 (comment)

I simply modified the code and tested it. Does have an impact on the effect of reasoning.
This character mark is backward,是否是这里的原因?还是说fastchat的英文对话模板对baichuan2产生了降智的影响?

新版fastchat似乎解决了一部分,但是发现只要在输入提示词中提到“英文”两个字,输出就非常差。

对比一下两者模板差异

Sign up or log in to comment