Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(scicode): read assistant text blocks#1381

Merged
Yunnglin merged 2 commits into
modelscope:mainmodelscope/evalscope:mainfrom
he-yufeng:fix/scicode-list-contenthe-yufeng/evalscope:fix/scicode-list-contentCopy head branch name to clipboard
May 29, 2026
Merged

fix(scicode): read assistant text blocks#1381
Yunnglin merged 2 commits into
modelscope:mainmodelscope/evalscope:mainfrom
he-yufeng:fix/scicode-list-contenthe-yufeng/evalscope:fix/scicode-list-contentCopy head branch name to clipboard

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • use ChatMessage.text when collecting SciCode assistant solutions
  • keep the existing markdown code-fence extraction behavior unchanged
  • add regression coverage for assistant messages whose content is stored as text blocks

Fixes #1380.

To verify

  • python -m py_compile evalscope\benchmarks\scicode\util.py tests\benchmark\test_scicode_util.py
  • python -m pytest tests\benchmark\test_scicode_util.py -q
  • python -m flake8 evalscope\benchmarks\scicode\util.py tests\benchmark\test_scicode_util.py
  • python -m yapf --diff evalscope\benchmarks\scicode\util.py tests\benchmark\test_scicode_util.py
  • git diff --check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the code extraction logic in evalscope/benchmarks/scicode/util.py by accessing message.text directly instead of casting message.content to a string. It also adds a unit test in tests/benchmark/test_scicode_util.py to verify that get_generated_code correctly handles assistant messages with text content blocks. There are no review comments to address, and the changes appear correct and complete.

@he-yufeng
he-yufeng force-pushed the fix/scicode-list-content branch from 95ff96d to dad292d Compare May 29, 2026 09:49

@Yunnglin Yunnglin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Fixed a minor yapf formatting issue and pushed the fix.

@Yunnglin

Copy link
Copy Markdown
Collaborator

I pushed a small formatting fix (yapf) to your branch — the list comprehension in util.py and the test file needed minor style adjustments to pass make lint. Everything else looks good!

@Yunnglin
Yunnglin merged commit 846e583 into modelscope:main May 29, 2026
Abhijnya002 pushed a commit to Abhijnya002/evalscope that referenced this pull request Jun 1, 2026
Royniel pushed a commit to Royniel/evalscope that referenced this pull request Jun 10, 2026
* fix(scicode): read assistant text blocks

* style: fix yapf formatting

---------

Co-authored-by: Yunnglin <mao.looper@qq.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.

测试数据集scicode报错AttributeError: 'list' object has no attribute 'replace'

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.