Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions vllm_spyre/model_executor/model_loader/spyre.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ def __init__(
elif self.config.model_type == "gpt_bigcode":
self.kv_cache_specs["num_layers"] = self.config.n_layer
self.kv_cache_specs["head_dim"] = self.config.n_embd // self.config.n_head
elif self.config.model_type == "pixtral":
self.kv_cache_specs["num_layers"] = self.config.text_config.num_hidden_layers
self.kv_cache_specs["head_dim"] = self.config.text_config.head_dim
else:
raise NotImplementedError(
f"[SpyreCausalLM] model type {self.config.model_type} "
Expand Down
6 changes: 6 additions & 0 deletions vllm_spyre/v1/worker/spyre_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ def build_input_batch(self) -> SamplingInputBatch:

@property
def vocab_size(self) -> int:
cfg = self.model.model.model.config
# Mistral3 MM models, which currently only run text;
# TODO (Alex) move this to utils after granite vision
# is merged.
if hasattr(cfg, "text_config"):
return cfg.text_config.src_vocab_size
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: next line can be modified to be cfg.src_vocab_size

return self.model.model.model.config.src_vocab_size

def pad_input_ids(
Expand Down