Skip to content

Commit 4e40c90

Browse files
committed
Rebase to main
Signed-off-by: southfreebird <yvorott@gmail.com>
1 parent 525f055 commit 4e40c90

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/entrypoints/llm/test_guided_generate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def get_llm_kwargs(mode: str):
3030
if mode == "autoregressive":
3131
return {}
3232
return {
33-
"speculative_model": "Qwen/Qwen2.5-0.5B-Instruct",
34-
"num_speculative_tokens": 3,
33+
"speculative_config": {
34+
"model": "Qwen/Qwen2.5-0.5B-Instruct",
35+
"num_speculative_tokens": 3,
36+
},
3537
}
3638

3739
test_llm_kwargs = get_llm_kwargs(request.param)

vllm/model_executor/guided_decoding/xgrammar_decoding.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def from_guided_params(
176176
)
177177
num_lookahead_slots = (speculative_config.num_lookahead_slots
178178
if speculative_config else None)
179+
print("num_lookahead_slots", num_lookahead_slots)
179180

180181
if guided_params.json:
181182
if not isinstance(guided_params.json, str):
@@ -274,6 +275,7 @@ def from_guided_params(
274275
tokenizer_hash=tokenizer_hash,
275276
max_threads=max_threads,
276277
tokenizer_data=tokenizer_data,
278+
num_lookahead_slots=num_lookahead_slots,
277279
)
278280
else:
279281
raise ValueError(
@@ -372,6 +374,7 @@ def __call__(self, input_ids: list[int],
372374
if len(self.matchers) == 0:
373375
max_rollback_tokens = (self.config.num_lookahead_slots
374376
if self.config.num_lookahead_slots else 0)
377+
print("max_rollback_tokens", max_rollback_tokens)
375378
self.matchers = [
376379
xgr.GrammarMatcher(self.ctx,
377380
max_rollback_tokens=max_rollback_tokens)

0 commit comments

Comments
 (0)