|
12 | 12 |
|
13 | 13 | import numpy as np |
14 | 14 | import torch |
| 15 | +import verl |
15 | 16 | from codetiming import Timer |
16 | 17 | from omegaconf import OmegaConf |
17 | 18 | from tqdm import tqdm |
@@ -298,14 +299,20 @@ def fit(self): |
298 | 299 | assert self.async_rollout_mode, "If agent mode is enabled, async server must be enabled" |
299 | 300 | if self.adapter is not None and not isinstance(self.adapter, TraceToTripletBase): |
300 | 301 | raise ValueError("Adapter must be a TraceToTripletBase for currently VERL implementation.") |
| 302 | + verl_version = verl.__version__ |
| 303 | + if verl_version == "0.5.0": |
| 304 | + # Note (Zhiyuan): To avoid further patch into vllm async server, using the same sentence to get the naming here. |
| 305 | + # However, it is possible that verl updates the naming and causes incompatibility. |
| 306 | + # Reference: https://github.com/volcengine/verl/blob/5b5e09d9cc20625e436d01f69d9cc739ff681c54/verl/workers/rollout/vllm_rollout/vllm_async_server.py#L217 |
| 307 | + model = "/".join(self.config.actor_rollout_ref.model.path.split("/")[-2:]) |
| 308 | + else: |
| 309 | + # For other versions (e.g., 0.6.0), we use the full path to the model. |
| 310 | + model = self.config.actor_rollout_ref.model.path |
301 | 311 | self.agent_mode_daemon = AgentModeDaemon( |
302 | 312 | self.config.agentlightning.port, |
303 | 313 | self.config.actor_rollout_ref.rollout.n, |
304 | 314 | train_information={ |
305 | | - # Note (Zhiyuan): To avoid further patch into vllm async server, using the same sentence to get the naming here. |
306 | | - # However, it is possible that verl updates the naming and causes incompatibility. |
307 | | - # Reference: https://github.com/volcengine/verl/blob/5b5e09d9cc20625e436d01f69d9cc739ff681c54/verl/workers/rollout/vllm_rollout/vllm_async_server.py#L217 |
308 | | - "model": "/".join(self.config.actor_rollout_ref.model.path.split("/")[-2:]), |
| 315 | + "model": model, |
309 | 316 | "temperature": self.config.actor_rollout_ref.rollout.temperature, |
310 | 317 | }, |
311 | 318 | tokenizer=self.tokenizer, |
|
0 commit comments