Skip to content

Commit a71e754

Browse files
authored
Fix trainer bugs in v0.1 (#24)
1 parent befec0e commit a71e754

File tree

3 files changed

+216
-203
lines changed

3 files changed

+216
-203
lines changed

agentlightning/trainer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ def _worker_main_loop(self, agent: LitAgent, worker_id: int, is_async: bool):
162162

163163
# Now we are in child processes, so we can safely set up the environment.
164164
agent.set_trainer(self)
165+
# TODO: this should be set elsewhere
166+
if agent.trained_agents:
167+
self.triplet_exporter.agent_match = agent.trained_agents
165168
self._initialize_worker_env(worker_id)
166169

167170
mode = "Async" if is_async else "Sync"

agentlightning/verl/daemon.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ def __init__(
102102
mini_batch_size,
103103
pad_token_id,
104104
reward_fillna_value=0.0,
105+
llm_timeout_seconds=600.0,
105106
):
106107
# Server and Task Configuration
107108
self.server_port = port
108-
self.task_timeout_seconds = 180
109+
self.llm_timeout_seconds = llm_timeout_seconds
109110
self.server = AgentLightningServer(
110-
host="0.0.0.0", port=self.server_port, task_timeout_seconds=self.task_timeout_seconds
111+
host="0.0.0.0", port=self.server_port, task_timeout_seconds=self.llm_timeout_seconds
111112
)
112113
self.proxy_port = _find_available_port() # Run proxy on a different port
113114

@@ -168,7 +169,7 @@ def proxy(path):
168169
data=request.get_data(),
169170
cookies=request.cookies,
170171
allow_redirects=False,
171-
timeout=self.task_timeout_seconds,
172+
timeout=self.llm_timeout_seconds,
172173
)
173174
# Filter out hop-by-hop headers before returning the response
174175
excluded_headers = [

0 commit comments

Comments
 (0)