Skip to content

Commit

Permalink
fix out of range and no attribute errors
Browse files Browse the repository at this point in the history
Signed-off-by: Sungjae Lee <[email protected]>
  • Loading branch information
llsj14 committed Jan 13, 2025
1 parent 20fbcaa commit 1b4bbd7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions vllm/spec_decode/spec_decode_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,14 +1142,18 @@ def _vocab_size(self) -> int:
# to the vocabulary size for kernel compatibility.
lora_vocab_padding_sizes = [
worker.lora_config.lora_vocab_padding_size
for worker in [self.proposer_worker, self.scorer_worker]
if worker.lora_config is not None
for worker in [self.proposer_worker, self.scorer_worker] if
hasattr(worker, 'lora_config') and worker.lora_config is not None
and worker.lora_config.lora_vocab_padding_size is not None
]
assert all(lora_vocab_padding_sizes[0] == vocab_size
for vocab_size in lora_vocab_padding_sizes)

return orig_vocab_sizes[0] + lora_vocab_padding_sizes[0]
vocab_size = orig_vocab_sizes[0]
if lora_vocab_padding_sizes:
vocab_size = orig_vocab_sizes[0] + lora_vocab_padding_sizes[0]

return vocab_size

@property
def rank(self):
Expand Down

0 comments on commit 1b4bbd7

Please sign in to comment.