mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-19 15:47:17 +08:00
simplify code
This commit is contained in:
parent
1936d7bab0
commit
8c7bab79f5
@ -651,11 +651,12 @@ class Scheduler:
|
|||||||
assert len(waiting_seqs) == 1, (
|
assert len(waiting_seqs) == 1, (
|
||||||
"Waiting sequence group should have only one prompt "
|
"Waiting sequence group should have only one prompt "
|
||||||
"sequence.")
|
"sequence.")
|
||||||
|
waiting_seq = waiting_seqs[0]
|
||||||
num_new_tokens = self._get_num_new_tokens(seq_group,
|
num_new_tokens = self._get_num_new_tokens(seq_group,
|
||||||
SequenceStatus.WAITING,
|
SequenceStatus.WAITING,
|
||||||
enable_chunking, budget)
|
enable_chunking, budget)
|
||||||
if not enable_chunking:
|
if not enable_chunking:
|
||||||
num_prompt_tokens = waiting_seqs[0].get_len()
|
num_prompt_tokens = waiting_seq.get_len()
|
||||||
assert num_new_tokens == num_prompt_tokens
|
assert num_new_tokens == num_prompt_tokens
|
||||||
|
|
||||||
prompt_limit = self._get_prompt_limit(seq_group)
|
prompt_limit = self._get_prompt_limit(seq_group)
|
||||||
@ -663,8 +664,7 @@ class Scheduler:
|
|||||||
logger.warning(
|
logger.warning(
|
||||||
"Input prompt (%d tokens) is too long"
|
"Input prompt (%d tokens) is too long"
|
||||||
" and exceeds limit of %d", num_new_tokens, prompt_limit)
|
" and exceeds limit of %d", num_new_tokens, prompt_limit)
|
||||||
for seq in waiting_seqs:
|
waiting_seq.status = SequenceStatus.FINISHED_IGNORED
|
||||||
seq.status = SequenceStatus.FINISHED_IGNORED
|
|
||||||
ignored_seq_groups.append(seq_group)
|
ignored_seq_groups.append(seq_group)
|
||||||
waiting_queue.popleft()
|
waiting_queue.popleft()
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user