Reduce AutoWeightsLoader kwargs (#53106)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -380,6 +380,12 @@ class KimiAudioForConditionalGeneration(
|
||||
"model.embed_tokens.": "language_model.model.embed_tokens.",
|
||||
"model.norm.": "language_model.model.norm.",
|
||||
"lm_head.": "language_model.lm_head.",
|
||||
# MIMO/TTS weights and any `model.` residue no rule above
|
||||
# claimed: this model only does ASR (speech-to-text).
|
||||
"model.": None,
|
||||
"mimo_layers.": None,
|
||||
"mimo_output.": None,
|
||||
"mimo_norm.": None,
|
||||
},
|
||||
orig_to_new_substr={
|
||||
".fc1.": ".mlp.fc1.",
|
||||
@@ -573,21 +579,8 @@ class KimiAudioForConditionalGeneration(
|
||||
return self.language_model.compute_logits(hidden_states)
|
||||
|
||||
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
|
||||
"""Load weights, skipping MIMO layers (TTS-only) for ASR."""
|
||||
# Filter out MIMO/TTS weights since we only do ASR (speech-to-text)
|
||||
skipped_patterns = [
|
||||
# Audio tower
|
||||
"model.",
|
||||
# MIMO/TTS
|
||||
"mimo_layers.",
|
||||
"mimo_output.",
|
||||
"mimo_norm.",
|
||||
]
|
||||
|
||||
# Load main model weights (LLM + projector) with mapper
|
||||
loader = AutoWeightsLoader(self, skip_prefixes=skipped_patterns)
|
||||
loaded = loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|
||||
return loaded
|
||||
loader = AutoWeightsLoader(self)
|
||||
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|
||||
|
||||
@classmethod
|
||||
def get_speech_to_text_config(
|
||||
|
||||
Reference in New Issue
Block a user