Spaces:
Running
Running
Commit ·
deab900
1
Parent(s): 550a83e
fix: stub GuidedDecodingParams for vLLM 0.19+ / TRL compatibility
Browse filesvLLM 0.19.1 moved GuidedDecodingParams; TRL's grpo_trainer imports it at
module load time. We don't use vLLM-guided decoding so a type stub is safe.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- train/grpo_train.py +10 -0
train/grpo_train.py
CHANGED
|
@@ -18,6 +18,16 @@ import sys
|
|
| 18 |
from pathlib import Path
|
| 19 |
from typing import Any
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")
|
| 22 |
logger = logging.getLogger("grpo_train")
|
| 23 |
|
|
|
|
| 18 |
from pathlib import Path
|
| 19 |
from typing import Any
|
| 20 |
|
| 21 |
+
# vLLM 0.19+ moved GuidedDecodingParams; TRL's grpo_trainer imports it at load
|
| 22 |
+
# time and crashes. We don't use vLLM-guided decoding, so stub it out before
|
| 23 |
+
# importing anything from trl.
|
| 24 |
+
try:
|
| 25 |
+
import vllm.sampling_params as _vsp
|
| 26 |
+
if not hasattr(_vsp, "GuidedDecodingParams"):
|
| 27 |
+
_vsp.GuidedDecodingParams = type("GuidedDecodingParams", (), {})
|
| 28 |
+
except ImportError:
|
| 29 |
+
pass
|
| 30 |
+
|
| 31 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")
|
| 32 |
logger = logging.getLogger("grpo_train")
|
| 33 |
|