Skip to content

Conversation

@mzbac
Copy link
Contributor

@mzbac mzbac commented Feb 21, 2024

Update the clip model format to HF format to make it easier for later use as a vision tower in the llava model.
close #463

image

@mzbac mzbac marked this pull request as ready for review February 21, 2024 12:27
Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Awesome!! Thank you! That is a big improvement.

I left a few minor comments, let me know what you think then we can merge.

Co-authored-by: Awni Hannun <[email protected]>
@mzbac mzbac mentioned this pull request Feb 22, 2024
@mzbac
Copy link
Contributor Author

mzbac commented Feb 22, 2024

@awni, thanks for helping with reviewing the PR. I have addressed all the comments, it should be ready to merge now. Please let me know if there are any other changes needed.

@awni
Copy link
Member

awni commented Feb 22, 2024

@mzbac let me know when I should check this again

@mzbac
Copy link
Contributor Author

mzbac commented Feb 22, 2024

@awni, this is ready for merging. Once this is merged, I will work with @nkasmanoff on #461

if "position_ids" in k:
# Remove unused position_ids
continue
elif "patch_embedding.weight" in k:
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!!

@awni awni merged commit 47dd6bd into ml-explore:main Feb 23, 2024
@awni
Copy link
Member

awni commented Feb 23, 2024

Thanks!!

@mzbac mzbac deleted the clip branch March 3, 2024 06:41
devonthomas35 pushed a commit to devonthomas35/mlx-examples that referenced this pull request Mar 11, 2024
…rmat (ml-explore#472)

* chore(clip): update the clip model to be HF format

* Update clip/convert.py

Co-authored-by: Awni Hannun <[email protected]>

* chore: address comments

* chore: rename ClipVisionModel and ClipTextModel

* chore: add output hidden_states support

* chore: remove custom conv2d and apply weight transpose during weight sanitizing

* Update clip/model.py

* Update clip/model.py

---------

Co-authored-by: Awni Hannun <[email protected]>
junpeiz pushed a commit to junpeiz/mlx-examples that referenced this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the HF format clip example

2 participants