-
Notifications
You must be signed in to change notification settings - Fork 414
Fix MLX-VLM snippet and prio hf_xet for MLX models #1463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
27f1cb6
Fix MLX-VLM snippet and prio hf_xet.
Vaibhavs10 3c5ab82
Add performance env variable for hf_xet.
Vaibhavs10 f8c4843
Review.
Vaibhavs10 2552d3e
Merge branch 'main' into vb/fix-mlx-vlm-snippet
Vaibhavs10 a99d8b3
Merge branch 'main' into vb/fix-mlx-vlm-snippet
Vaibhavs10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1355,15 +1355,14 @@ model = SwarmFormerModel.from_pretrained("${model.id}") | |
|
||
const mlx_unknown = (model: ModelData): string[] => [ | ||
`# Download the model from the Hub | ||
pip install huggingface_hub hf_transfer | ||
pip install huggingface_hub[hf_xet] | ||
|
||
export HF_HUB_ENABLE_HF_TRANSFER=1 | ||
huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} ${model.id}`, | ||
]; | ||
|
||
const mlxlm = (model: ModelData): string[] => [ | ||
`# Make sure mlx-lm is installed | ||
pip install --upgrade mlx-lm | ||
# pip install --upgrade mlx-lm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah good call, no longer a cli |
||
|
||
# Generate text with mlx-lm | ||
from mlx_lm import load, generate | ||
|
@@ -1376,7 +1375,7 @@ text = generate(model, tokenizer, prompt=prompt, verbose=True)`, | |
|
||
const mlxchat = (model: ModelData): string[] => [ | ||
`# Make sure mlx-lm is installed | ||
pip install --upgrade mlx-lm | ||
# pip install --upgrade mlx-lm | ||
|
||
# Generate text with mlx-lm | ||
from mlx_lm import load, generate | ||
|
@@ -1393,7 +1392,9 @@ text = generate(model, tokenizer, prompt=prompt, verbose=True)`, | |
]; | ||
|
||
const mlxvlm = (model: ModelData): string[] => [ | ||
`Make sure mlx-vlm is installed | ||
`# Make sure mlx-vlm is installed | ||
# pip install --upgrade mlx-vlm | ||
|
||
from mlx_vlm import load, generate | ||
from mlx_vlm.prompt_utils import apply_chat_template | ||
from mlx_vlm.utils import load_config | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @jsulz - should we put any other env variables here? IIRC no, but wondering if you'd recommend any!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this here: 3c5ab82