File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def to_trinity_config(
109109 config .buffer .batch_size = algorithm .batch_size
110110 config .trainer .save_interval = algorithm .save_interval_steps
111111 config .explorer .eval_interval = algorithm .eval_interval_steps
112- return config . check_and_update ()
112+ return config
113113
114114
115115def check_workflow_function (
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22"""The main entry point for agent learning."""
3+ import os
34from ._workflow import WorkflowType
45from ._judge import JudgeType
56from ._model import TunerChatModel
@@ -48,6 +49,7 @@ def tune(
4849 """
4950 try :
5051 from trinity .cli .launcher import run_stage
52+ from trinity .utils .dlc_utils import setup_ray_cluster , stop_ray_cluster
5153 except ImportError as e :
5254 raise ImportError (
5355 "Trinity-RFT is not installed. Please install it with "
@@ -69,7 +71,13 @@ def tune(
6971 algorithm = algorithm ,
7072 experiment_name = experiment_name ,
7173 )
72-
73- return run_stage (
74- config = config ,
75- )
74+ use_dlc = os .environ .get ("USE_ALIYUN_PAI_DLC" , "0" ) == "1"
75+ if use_dlc :
76+ setup_ray_cluster (config , namespace = "agentscope" )
77+ try :
78+ return run_stage (
79+ config = config .check_and_update (),
80+ )
81+ finally :
82+ if use_dlc :
83+ stop_ray_cluster (namespace = "agentscope" )
You can’t perform that action at this time.
0 commit comments