-
Notifications
You must be signed in to change notification settings - Fork 1
ChatTemplateへの対応およびReasoning Contentのparse機能実装 (vllm) #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
outputs = self.model.generate(sampling_params=sampling_params, prompt_token_ids=prompt_tokens) | ||
for i, output in enumerate(outputs): | ||
results["samples"][i]["generated"] = output.outputs[0].text | ||
if hasattr(self.cfg.model, "reasoning_parser"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
基本的にはparseするようにしただけなので影響はないはずなんですが、データセット途中から以下のような出力を繰り返すようになっており、こちらは原因調査中です
(reasoning enable時のみで、モデル起因か、vllm起因なので今回の修正には基本関係ないと思われます)
"أستاره تamientos\n\nتamientos\n\nتamientos\n\nتamientos\n\nتamientos\n\nتamientos\n\nتamientos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらおそらく enable_prefix_caching
のせいでした
"vllm==0.6.3", | ||
"vllm-flash-attn", | ||
"transformers>=4.45.1", | ||
"vllm==v0.9.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最新までversionを上げました
for target_dataset, target_data in dataset.items(): | ||
samples = [sample["prompt"] for sample in target_data["samples"]] | ||
prompt_tokens = self.tokenizer(samples, **self.cfg.tokenize_kwargs)["input_ids"] | ||
if self.cfg.apply_chat_template and self.tokenizer.chat_template is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらは、トークナイザーに chat template が存在しない場合(=モデルが chat template をサポートしない)、
それをメッセージとしてユーザーに知らせても良いと思いましたが、いかがでしょう?
ただこれはどちらかというとこちらの親切なメッセージであって、
特に必須というわけではありませんので、
堀江さんがいらないと判断しましたなら、なくても全然良いと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます、こちら以下のように警告文を追加しました 🙏
00e1003
確認が遅くなり申し訳ありません。 |
まだ理由は把握しておりませんが、こちらのブランチを適用すると、
ここの修正がどうしてエラーに繋がるかは分かりませんが、取り急ぎ報告します。 |
こちら、 llm-jp-eval 側の問題でしたので、このPRは問題ないと思います。 |
apply_chat_template
というフラグを用意し、chat_templateが存在する場合にチャット形式でpromptを作成出来るように機能実装しました。また、vllmのreasoning parserを利用したreasoning contentのparse機能を実装しました。
以下のようなconfigを用意し、thinking enable/disableで動作確認をしました。
出力の一部