fix: continue loop on Analyze-only responses instead of terminating early#92
Open
haosenwang1018 wants to merge 1 commit intoruc-datalab:mainfrom
Open
Conversation
…arly When the model returns an <Analyze>-only response (no <Code> block), the generate() loop previously broke out immediately, even without an <Answer>. This caused premature termination before code execution. Now the loop only terminates when <Answer> is present. Analyze-only responses are appended to the conversation and the loop continues. Fixes ruc-datalab#86 Signed-off-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
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.
Problem
DeepAnalyzeVLLM.generate()terminates the client loop whenever the model returns a response without a<Code>block, even if no<Answer>is present (line 119):This means
<Analyze>-only responses (valid intermediate reasoning steps) cause premature termination before any code is executed.Fix
<Answer>is found in the response.<Code>nor<Answer>is present, append the response to the conversation history and continue to the next round, allowing the model to produce a follow-up with code.Fixes #86