Skip to content

fix: continue loop on Analyze-only responses instead of terminating early#92

Open
haosenwang1018 wants to merge 1 commit intoruc-datalab:mainfrom
haosenwang1018:fix/analyze-only-loop-termination
Open

fix: continue loop on Analyze-only responses instead of terminating early#92
haosenwang1018 wants to merge 1 commit intoruc-datalab:mainfrom
haosenwang1018:fix/analyze-only-loop-termination

Conversation

@haosenwang1018
Copy link
Copy Markdown
Contributor

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):

if not code_match or "<Answer>" in ans:
    break

This means <Analyze>-only responses (valid intermediate reasoning steps) cause premature termination before any code is executed.

Fix

  • Only break the loop when <Answer> is found in the response.
  • When neither <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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeepAnalyzeVLLM.generate() terminates early on <Analyze>-only response (no <Code>)

1 participant