Skip to content

Commit 88be3e4

Browse files
committed
comments to english
1 parent a478827 commit 88be3e4

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

ajet/context_tracker/base_tracker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from typing import List, Tuple, Union
2-
from typing import List, Union, Tuple, Dict, Optional
1+
from typing import Any, Dict, List, Optional, Tuple, Union
32
from ajet.schema.task import WorkflowTask
43

54
from ajet.schema.extended_msg import (
@@ -141,7 +140,7 @@ def __init__(self, config, tokenizer, workflow_task: WorkflowTask, **kwargs):
141140
self.already_mad_flag: bool = False
142141
self.round_cnt = 0
143142
self.generation_prompt_token = None
144-
self.log_metrics: Optional[Dict[str, Union[float, List[float]]]] = None # Initialize workflow_metadata to store tool statistics
143+
self.log_metrics: Optional[Dict[str, Union[float, List[float], Dict[str, Any]]]] = None # Initialize workflow_metadata to store tool statistics
145144

146145
assert (
147146
self.config.ajet.data.max_prompt_length

ajet/task_reader/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, reader_type, reader_config):
6262
elif task_reader_type == "random_dummy":
6363
self.task_reader = RandomDummyTaskReader(reader_config)
6464
elif task_reader_type == "deep_finance":
65-
# deep_finance 专用: 数据从 JSON 文件加载并组装 init_messages,工具调用走 env_service
65+
# deep_finance: load message from JSON file and assemble init_messages, tool calls go through env_service
6666
from tutorial.example_deep_finance.deep_finance_reader import DeepFinanceReader
6767
self.task_reader = DeepFinanceReader(reader_config)
6868
else:

ajet/task_rollout/resource_keeper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@ def _initialize_environment_and_messages(self) -> List[dict]:
9898
self.env.release_instance(self.workflow_task.episode_uuid)
9999
raise e
100100
elif reader_type == "deep_finance":
101-
# deep_finance: 调用 create_instance 注册实例,但使用 reader 组装的 init_messages
101+
# deep_finance: call create_instance to register instance, but use init_messages assembled by the reader
102102
if self.env is None:
103103
raise ValueError("Environment client is None but deep_finance type is specified")
104104
try:
105-
# 必须调用 create_instance,让服务端创建实例,后续 step() 才能工作
105+
# call create_instance, let the server create an instance, so that subsequent step() can work
106106
self.env.create_instance(
107107
env_type=self.env_type,
108108
task_id=self.task_id,
109109
instance_id=self.workflow_task.episode_uuid,
110110
params=self.env_params,
111111
)
112-
# 不使用返回的 state,直接用 reader 组装的 init_messages
112+
# Do not use the returned state, directly use the init_messages assembled by the reader
113113
task = self.workflow_task.task
114114
if task.init_messages:
115115
init_messages = task.init_messages

ajet/task_runner/general_runner.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ def execute(self, workflow_task: WorkflowTask) -> BaseContextTracker:
5454
)
5555
else:
5656
raw_reward, is_success = self.get_judge().compute_reward(workflow_task, workflow_output)
57-
# Sync reward_stats from metadata to log_metrics after judge computation
5857

59-
if "reward_stats" in workflow_output.metadata:
58+
if "reward_stats" in workflow_output.metadata:
59+
workflow_output.log_metrics["reward_stats"] = workflow_output.metadata["reward_stats"]
6060

61-
workflow_output.log_metrics["reward_stats"] = workflow_output.metadata["reward_stats"]
62-
6361
workflow_task.gym_env = None # clear gym env client reference to avoid serialization issue
6462

6563
assert not isinstance(

0 commit comments

Comments
 (0)