Skip to content

Commit b96b841

Browse files
committed
fix comments
1 parent fcb40aa commit b96b841

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

tests/ray/test_mock_rollout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
MODEL_PATH = os.environ["ROLLOUT_MODEL_PATH"]
1818
TRAIN_DATA_PATH = os.environ["ROLLOUT_DATA_PATH"]
19-
TEST_DATA_PATH = os.environ["ROLLOUT_DATA_PATH"]
2019
resource_map = {"npu": "NPU", "cuda": "GPU"}
2120

2221
@ray.remote

xtuner/v1/ray/environment/single_turn_env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class SingleTurnEnvironment(BaseEnvironment):
3030
judger_pg (Any): The placement group for scheduling judger Ray actors.
3131
Defaults to None indicates using the rollout_pg.
3232
judger_cfg (optional): Configuration for the judger controller. Defaults to None.
33+
rollout_controller (optional): An instance of the rollout controller. Defaults to None.
34+
judger_controller (optional): An instance of the judger controller. Defaults to None.
3335
"""
3436

3537
def __init__(

xtuner/v1/ray/rollout/controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,10 @@ def deactivate_worker_by_url(self, url):
269269
f"Rollout worker {url} failed {self.url_failed_counts[url]} times, but not deactivated yet."
270270
)
271271
return
272-
self.logger.error(f"Deactivating rollout worker {url} due to repeated failures.")
273272
inactive_workers = self.active_url_to_workers.get(url)
274-
self.active_workers_to_status[inactive_workers] = False
273+
if inactive_workers:
274+
self.logger.warning(f"Deactivating rollout worker {url} due to repeated failures.")
275+
self.active_workers_to_status[inactive_workers] = False
275276

276277
async def rollout(
277278
self,

xtuner/v1/utils/httpx_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
import traceback
23
from dataclasses import dataclass, field
34
from enum import IntEnum
@@ -80,8 +81,10 @@ def __post_init__(self):
8081
error_msg is not already set."""
8182
# Only generate a message if one hasn't been provided already.
8283
if self.error_msg is None and self.error_type != HttpRequestErrorType.SUCCESS:
84+
log_payload = {}
8385
if self.payload is not None and "input_ids" in self.payload:
84-
self.payload["input_ids"] = str(self.payload["input_ids"])
86+
log_payload = copy.deepcopy(self.payload)
87+
log_payload["input_ids"] = str(log_payload["input_ids"])
8588

8689
default_messages = {
8790
HttpRequestErrorType.UNKNOWN_ERROR: f"An unknown error {self.exception} occurred, Traceback: {traceback.format_exc()}",
@@ -105,7 +108,7 @@ def __post_init__(self):
105108
)
106109
if self.error_type == HttpRequestErrorType.REQUEST_ERROR and self.exception:
107110
if hasattr(self.exception, "__cause__") and self.exception.__cause__:
108-
self.error_msg += f"__cause__: {self.exception.__cause__}"
111+
self.error_msg += f" __cause__: {self.exception.__cause__}"
109112

110113
@property
111114
def is_success(self) -> bool:

0 commit comments

Comments
 (0)