Repository navigation
Conversation
旧模块 ais_bench/benchmark/utils/model_postprocessors.py 改为薄兼容层,仅从新路径 ais_bench/benchmark/utils/postprocess/model_postprocessors.py 再导出 extract_non_reasoning_content,删除重复的 65 行实现与重复注册。 公开导入路径、函数行为、参数默认值、docstring、日志内容与注册 key 均保持不变;导入旧模块会连带注册新模块中的其余 postprocessor,属预期副作用。 新增单元测试:断言旧/新路径导出同一函数对象,并在 reload 旧模块后校验 TEXT_POSTPROCESSORS 中 extract-non-reasoning-content 仍指向新模块实现。 Signed-off-by: SJTUyh <[email protected]>
SJTUyh
had a problem deploying
to
smoke-test-approval
November 23, 2026 11:07 — with
GitHub Actions
Error
|
🚫 PR 合入质量检查未通过,PR 已被禁止合入。 未通过项:
请按上述提示整改后,重新推送(push)或评论本 PR 即可触发再次检查。 |
This branch was successfully deployed
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.
PR Type / PR类型
Related Issue | 关联 Issue
Fixes #704
🔍 Motivation / 变更动机
ais_bench/benchmark/utils/model_postprocessors.py已在文件头声明废弃,但仍完整复制了一份extract_non_reasoning_content,并以同一个 keyextract-non-reasoning-content注册到TEXT_POSTPROCESSORS。由于Registry.register_module默认force=True,最终生效的实现取决于导入顺序;一旦只修改其中一份,通过旧路径配置的任务会静默使用另一份实现。本 PR 将废弃模块收敛为薄兼容层。📝 Modification / 修改内容
ais_bench/benchmark/utils/model_postprocessors.py:删除 65 行重复实现与重复注册,改为从ais_bench/benchmark/utils/postprocess/model_postprocessors.py再导出extract_non_reasoning_content,并保留原有的废弃告警。tests/UT/utils/test_model_postprocessors.py:新增断言,旧/新路径导出同一函数对象;reload 旧模块后,TEXT_POSTPROCESSORS中extract-non-reasoning-content仍指向新模块实现。📐 Associated Test Results / 关联测试结果
本地环境:Windows,Python 3.11.4,commit
ce9ad9c。python -m pytest tests/UT/utils/test_model_postprocessors.py -q -k "not registered"→ 10 passed, 1 deselected(含新增用例)。python -m pytest tests/UT/utils/test_model_postprocessors.py -q→ 10 passed, 1 failed;失败项test_extract_non_reasoning_content_registered在本机 torchc10.dll初始化失败(WinError 1114),改动前基线同样失败,与本次改动无关,以 Linux CI 结果为准。python -m compileall -q ais_bench/benchmark/utils/model_postprocessors.py→ 通过。ruff check对本次新增代码无告警;文件内仍有 3 项改动前已存在的告警(第 1/3 行 import 排序与未使用的patch/Mock)。不适用。旧导入路径保留,
from ais_bench.benchmark.utils.model_postprocessors import extract_non_reasoning_content仍可用;导入旧模块会连带导入新模块并注册其其余 postprocessor,属预期副作用,不改变extract-non-reasoning-content的解析结果。不适用。纯重构,不涉及评测流程、数据集或结果格式,不新增依赖。
🌟 Use cases (Optional) / 使用案例(可选)
不适用。
✅ Checklist / 检查列表
Before PR:
After PR:
👥 Collaboration Info / 协作信息
test_extract_non_reasoning_content_registered在 Windows 本地的失败为 torch DLL 环境问题,请以 Linux CI 结果为准。