跳到正文
原文
Hugging Face Blog·· 2023-10-03精选AI 评分73

Hugging Face 引入 chat_template 属性以统一对话格式

Chat Templates: An End to the Silent Performance Killer

AI 导读

Hugging Face 在 Tokenizer 中引入 chat_template 属性,使用 Jinja 模板保存模型训练时的对话格式,防止因格式不匹配导致性能下降。用户可通过 apply_chat_template() 方法格式化输入,或提交 PR 为缺少模板的模型补充模板。

推荐理由

Hugging Face 在 Tokenizer 中引入 chat_template 属性,通过保存训练时的对话格式来避免推理时的性能下降。

来源:Hugging Face Blog · huggingface.co