Add ReasoningParser#287
Merged
Merged
Conversation
3827b57 to
9661b17
Compare
Kotaro-Aono
reviewed
May 25, 2026
| ] | ||
| lm_outputs = self._batch_complete_text(chat_messages_as_string, **kwargs) | ||
| if self.reasoning_parser: | ||
| for lm_output in lm_outputs: |
There was a problem hiding this comment.
ここではtoolのところにある
if lm_output.text is None: continue
的な処理はいらないんですかね?
Collaborator
Author
There was a problem hiding this comment.
そもそもtool, reasoning でfor文分かれてる意味ないなと思ったのでまとめた上で一番上にセットしました!
https://github.com/sbintuitions/flexeval/pull/287/changes#diff-9c4eb04cb0e3beb9678e4067391a29b6bfb2c25b6f1cf1de4729ddb6dba932deR429-R431
Kotaro-Aono
reviewed
May 25, 2026
| lm_output.text = reasoning.text | ||
| lm_output.reasoning_text = reasoning.reasoning_text | ||
|
|
||
| if self.tool_parser: |
There was a problem hiding this comment.
resoning parserとtool_parserの同時使用って想定されていますか?
想定しているなら下でraw_textとかが上書きされてしまうのでまずい気がします
Collaborator
Author
There was a problem hiding this comment.
同時使用はあり得ます。
想定としては raw_text は何であれ後処理が入る前のテキストが入るので、そうなるように修正しました
(commit 操作ミスって色々くっついちゃいましたが…)
6a5523e to
7dc3f8c
Compare
6a6fd48 to
9acc5ad
Compare
Collaborator
Author
|
@Kotaro-Aono レビューありがとうございます!諸々対応しました |
Kotaro-Aono
reviewed
Jun 1, 2026
| response = chat_lm.generate_chat_response([{"role": "user", "content": "test"}], max_new_tokens=1) | ||
| assert response.raw_text == raw_output | ||
| assert response.text is None | ||
| assert response.reasoning_text is raw_output |
There was a problem hiding this comment.
ここが悪さしてそうです
reasoning_text == None
raw_output == "no think tags here"
なので
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a mechanism to the
VLLMandHuggingFaceLMclasses to extract the reasoning content and store it inLMOutput.reasoning_text.Example
flexeval_lm --eval_setup rakuda-v2-ja --language_model VLLM --language_model.model Qwen/Qwen3-4B --language_model.reasoning_parser UnifiedRegexReasoningParser --language_model.reasoning_parser.pattern="<think>(?P<reasoning_content>.*?)</think>(?P<content>.*)"