Skip to content

Commit

Permalink
more rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
bursteratom committed Dec 10, 2024
1 parent e7738dc commit a2250ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ def __init__(
# init model config
self.model_config = load_model_config(cfg)
if cfg.is_multimodal:
self.text_model_config = self.model_config.text_config
try:
self.text_model_config = self.model_config.text_config
except AttributeError:
# for qwen2_vl
self.text_model_config = self.model_config.get_text_config()
else:
self.text_model_config = self.model_config

Expand Down Expand Up @@ -1071,7 +1075,9 @@ def load_model(self) -> Tuple[PreTrainedModel, Optional[PeftConfig]]:
and self.model.get_input_embeddings().num_embeddings < embeddings_len
):
resize_kwargs = {}
if self.cfg.mean_resizing_embeddings is not None:
if self.cfg.mean_resizing_embeddings is not None and not (
self.model_config.model_type == "llava"
):
resize_kwargs["mean_resizing"] = self.cfg.mean_resizing_embeddings
self.model.resize_token_embeddings(embeddings_len, **resize_kwargs)
else:
Expand Down

0 comments on commit a2250ee

Please sign in to comment.