Skip to content

[local-apps] deeplink can take an optional filepath inside the repo #738

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 5 commits into from
Jun 28, 2024

Conversation

julien-c
Copy link
Member

@julien-c julien-c commented Jun 5, 2024

No description provided.

@mishig25
Copy link
Collaborator

mishig25 commented Jun 5, 2024

Thanks to recent updates on HF models hub, for local apps, it would be possible to specify an exact file in a repo rather than the entire repo (which can be a collection of different models/quants). Therefore, I think the proposed change would be a nice one 🤗

return [
`# Option 1: use llama.cpp with brew
brew install llama.cpp

# Load and run the model
llama \\
--hf-repo "${model.id}" \\
--hf-file file.gguf \\
--hf-file ${filepath ?? "file.gguf"} \\
Copy link
Member

Choose a reason for hiding this comment

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

This is nice!! 🔥

@@ -95,7 +95,8 @@ export const LOCAL_APPS = {
docsUrl: "https://lmstudio.ai",
mainTask: "text-generation",
displayOnModelPage: isGgufModel,
deeplink: (model) => new URL(`lmstudio://open_from_hf?model=${model.id}`),
deeplink: (model, filepath) =>
new URL(`lmstudio://open_from_hf?model=${model.id}` + filepath ? `&file=${filepath}` : ""),
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome addition. What would be the format of filepath? [filename].[ext]?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep sir, the full filepath (including any potential directory) inside the model repo

e.g. inside https://huggingface.co/bartowski/Codestral-22B-v0.1-GGUF it could be Codestral-22B-v0.1-IQ2_M.gguf or Codestral-22B-v0.1-f32.gguf/Codestral-22B-v0.1-f32-00001-of-00003.gguf for instance

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, thanks 👍

@julien-c
Copy link
Member Author

@mishig25 want to help me get this merged? (there's a conflict :) )

@mishig25 mishig25 merged commit 21d6b55 into main Jun 28, 2024
3 of 5 checks passed
@mishig25 mishig25 deleted the local-apps-deeplinks-specify-file branch June 28, 2024 12:59
@mishig25 mishig25 mentioned this pull request Jun 28, 2024
mishig25 pushed a commit that referenced this pull request Jun 28, 2024
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.

4 participants