Buckets:
| # 中文源码导读(2026-09-15)|阅读顺序 001|Baseline 接口 | |
| # 来源:Baseline:注释前 Python 语法树与官方对应文件一致。 | |
| # 作用:对外导出六个公共对象,是理解整个框架的入口。 | |
| # 对照基准:test-time-training/discover@6c40e82;完整路线见 docs/CODE_READING_ORDER_ZH.md。 | |
| import os | |
| # Ray CPU evaluator workers only need the sandbox submodules. Avoid importing | |
| # the complete trainer stack (chz, torch, tokenizer and local GPU backend) on | |
| # those deliberately lightweight nodes. Normal package imports keep the | |
| # original public API unchanged. | |
| _MINIMAL_EVALUATOR_IMPORT = os.environ.get("TTT_MINIMAL_EVALUATOR_IMPORT") == "1" | |
| if not _MINIMAL_EVALUATOR_IMPORT: | |
| # 公共入口:DiscoverConfig 描述实验;discover 接收配置并启动整个搜索/学习流程。 | |
| from ttt_discover.discovery import DiscoverConfig, discover | |
| # 任务接口:Environment 决定给模型什么题目,以及怎样解析、评估和保存候选。 | |
| from ttt_discover.tinker_utils.dataset_builder import Environment | |
| # 搜索记忆:State 保存某个节点的代码、构造结果、分数和父链,不保存 LLM 权重。 | |
| from ttt_discover.tinker_utils.state import State | |
| # 评分接口:BaseRewardEvaluator 定义契约;SandboxRewardEvaluator 提供 CPU 执行外壳。 | |
| from ttt_discover.environments.base_reward_evaluator import BaseRewardEvaluator | |
| from ttt_discover.environments.sandbox_reward_evaluator import SandboxRewardEvaluator | |
| # 公开导出名单:其他文件可写 from ttt_discover import ...;本文件仅组织入口,没有实现 PFG 修改。 | |
| __all__ = [] if _MINIMAL_EVALUATOR_IMPORT else [ | |
| "Environment", | |
| "DiscoverConfig", | |
| "discover", | |
| "State", | |
| "BaseRewardEvaluator", | |
| "SandboxRewardEvaluator", | |
| ] | |
Xet Storage Details
- Size:
- 1.83 kB
- Xet hash:
- a51acc74a32f136f7398b3cccba2055da340aed269dae9ccd1351581542c3d6d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.