Closed YanshekWoo closed 3 months ago
reserved_107是什么? 请教一下,这类chat template一般应该怎么写? 有的模型是支持工具调用以及代码解释器的,这类又应该怎么写?也可以写入chat template吗? 多谢!
reserved_107是什么? 请教一下,这类chat template一般应该怎么写? 有的模型是支持工具调用以及代码解释器的,这类又应该怎么写?也可以写入chat template吗? 多谢!
<reserved_107>
是预定义的special token。
chat template是参考huggingface官方文档写的。该template是为了多轮对话的prompt设计的。
我理解的工具调用之类的template应该由你自己设计定义好后输入到user轮的对话内容中
给LZ点赞,vllm 文档支持bc2但其实用的hf chat template, 还在想咋改 发现LZ这,好用,chat template jinja是什么魔法写法
谢谢回复
reserved_107是什么? 请教一下,这类chat template一般应该怎么写? 有的模型是支持工具调用以及代码解释器的,这类又应该怎么写?也可以写入chat template吗? 多谢!
<reserved_107>
是预定义的special token。chat template是参考huggingface官方文档写的。该template是为了多轮对话的prompt设计的。
我理解的工具调用之类的template应该由你自己设计定义好后输入到user轮的对话内容中
是不是没有考虑 system
? 另外,请问 </s>
是为什么?
是不是没有考虑
system
? 另外,请问</s>
是为什么?
Baichuan原生就没有system message
,这段代码是可以兼容处理有system message
的messages列表的。
</s>
之类special token都是baichuan chat模型微调用的,参照他代码里给的prompt
似乎目前版本的baichuan2还未提供huggingface支持的chat template 我自己写了一份chat template jinja如下:
即在
tokenizer_config.json
添加如下字段添加后可以正常使用huggingface的tokenizer.apply_chat_template和vllm调用