Skip to content

Commit

Permalink
Fixes (DeepSeek, Florence-2) (#156)
Browse files Browse the repository at this point in the history
* fix DeepSeek-VL2 quant loading

* fix florence LM only

* bump version
  • Loading branch information
Blaizzy authored Dec 22, 2024
1 parent 398cb62 commit f0b0058
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mlx_vlm/models/deepseek_vl_v2/deepseek_vl_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,12 @@ def from_pretrained(path_or_hf_repo: str):
@staticmethod
def sanitize(weights):
def transform_key(key):
if "language" in key:
if "language" in key and "language_model" not in key:
if ".model" in key:
key = key.replace("language.model", "language_model.model")
if ".lm_head" in key:
key = key.replace("language", "language_model")
if "vision" in key:
if "vision" in key and "vision_tower" not in key:
key = key.replace("vision", "vision.vision_tower")
if "view_seperator" in key:
key = key.replace("view_seperator", "view_separator")
Expand Down
3 changes: 3 additions & 0 deletions mlx_vlm/models/florence2/florence2.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ def __call__(
inputs_embeds, attention_mask = self._merge_input_ids_with_image_features(
image_features, inputs_embeds
)
else:
inputs_embeds = None
attention_mask = None

# Handle decoder input IDs
if labels is not None and decoder_input_ids is None:
Expand Down
2 changes: 1 addition & 1 deletion mlx_vlm/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.5"
__version__ = "0.1.6"

0 comments on commit f0b0058

Please sign in to comment.