From f8ce846ee74ba2ae6aa60b2e93c014c46f2b6485 Mon Sep 17 00:00:00 2001 From: jackkhuu Date: Tue, 7 Oct 2025 21:41:55 +0000 Subject: [PATCH] Fix dict conversion --- src/forge/actors/policy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/forge/actors/policy.py b/src/forge/actors/policy.py index 4a539f909..212f8831a 100644 --- a/src/forge/actors/policy.py +++ b/src/forge/actors/policy.py @@ -99,6 +99,12 @@ def from_dict(cls, d: Mapping): valid_args = {k: v for k, v in d.items() if k in all_fields} return cls(**valid_args) + def asdict(self): + # Use the full object instead of a Dict + ret = asdict(self) + ret["guided_decoding"] = self.guided_decoding + return ret + @dataclass class EngineConfig(EngineArgs): @@ -254,7 +260,7 @@ async def setup(self): # Setup sampling params self.sampling_params = get_default_sampling_params( - self.vllm_config, overrides=asdict(self.sampling_config) + self.vllm_config, overrides=self.sampling_config.asdict() ) # Setup processors