mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-23 04:30:10 +00:00
fix(annotate): drop guided_decoding=dict (api differs across vllm)
vllm 0.10.2 expects guided_decoding to be a GuidedDecodingParams object, not a dict. Different vllm versions differ here. The parser already has a one-retry JSON-recovery path, so drop guided decoding entirely for portability. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -169,11 +169,10 @@ def _make_vllm_client(config: VlmConfig) -> VlmClient:
|
|||||||
llm = LLM(**llm_kwargs)
|
llm = LLM(**llm_kwargs)
|
||||||
|
|
||||||
def _gen(batch: Sequence[Sequence[dict[str, Any]]], max_tok: int, temp: float) -> list[str]:
|
def _gen(batch: Sequence[Sequence[dict[str, Any]]], max_tok: int, temp: float) -> list[str]:
|
||||||
params = SamplingParams(
|
# ``guided_decoding`` would speed up parsing but its API differs across
|
||||||
max_tokens=max_tok,
|
# vllm releases (dict vs GuidedDecodingParams). The _GenericTextClient
|
||||||
temperature=temp,
|
# wrapper already has a one-retry JSON-recovery path, so we skip it.
|
||||||
guided_decoding={"json": {}} if config.json_mode else None,
|
params = SamplingParams(max_tokens=max_tok, temperature=temp)
|
||||||
)
|
|
||||||
prompts = [_messages_to_prompt(m) for m in batch]
|
prompts = [_messages_to_prompt(m) for m in batch]
|
||||||
outputs = llm.generate(prompts, params)
|
outputs = llm.generate(prompts, params)
|
||||||
return [o.outputs[0].text for o in outputs]
|
return [o.outputs[0].text for o in outputs]
|
||||||
|
|||||||
Reference in New Issue
Block a user