Skip to content

Conversation

@majiayu000
Copy link

Summary

  • Add explicit removal of <answer> and </answer> tags from model output
  • Use replace() instead of slice indexing for robust tag cleaning
  • Add tests to verify tag cleaning

Problem

The model sometimes outputs responses wrapped in <answer> tags:

{
  "_metadata": "do",
  "action": "Type",
  "text": "文件传输助手\")</answe"
}

This causes action parsing to fail or produce malformed output.

Solution

Add replace('<answer>', '') and replace('</answer>', '') at the beginning of parse_action to clean up these tags before parsing.

Fixes #258

Add explicit removal of <answer> and </answer> tags from model output
before parsing. This uses replace() instead of slice indexing to handle
cases where the model output format may vary.

The model sometimes outputs responses wrapped in <answer> tags, which
was causing action parsing to fail or produce malformed output.

Fixes zai-org#258
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.

数据清洗有格式问题

1 participant