fix: update GGUF save paths to use ~/.unsloth/llama.cpp with Windows support#4138
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the GGUF saving and pushing functionalities to seamlessly integrate with a new, standardized Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request updates GGUF save paths to use ~/.unsloth/llama.cpp and adds Windows support, which is a great improvement for cross-platform compatibility. The changes are well-aligned with the description, updating error messages and example usage paths to be platform-aware. I've found a small area for improvement regarding code duplication in the error handling logic, which can be refactored for better maintainability. Overall, this is a solid contribution.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9241e66be9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… paths with spaces
…ation error message
- H4: Add defensive try/except for LLAMA_CPP_DEFAULT_DIR and IS_WINDOWS imports with fallback defaults, so save.py works even if zoo PR #526 is not merged yet - H5: Fix Kaggle error path using plain "Error: {e}" instead of f"Error: {e}", so the actual exception is shown to users
for more information, see https://pre-commit.ci
Review: Fixes appliedPushed fixes for the issues identified during review of the companion zoo PR #526: Fixes in this commit
Testing
NoteThe Gemma3 compiler has a pre-existing syntax error bug (unmatched |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5915d43742
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…support (unslothai#4138) * fix: update GGUF save paths to use ~/.unsloth/llama.cpp with Windows support * fix: quote LLAMA_CPP_DEFAULT_DIR in fallback shell commands to handle paths with spaces * refactor: deduplicate platform-specific build instructions in quantization error message * chore: remove accidentally committed PR description file * Fix import safety and f-string bugs in save.py - H4: Add defensive try/except for LLAMA_CPP_DEFAULT_DIR and IS_WINDOWS imports with fallback defaults, so save.py works even if zoo PR unslothai#526 is not merged yet - H5: Fix Kaggle error path using plain "Error: {e}" instead of f"Error: {e}", so the actual exception is shown to users * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> Co-authored-by: Daniel Han <danielhanchen@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
Aligns
save_pretrained_ggufandpush_to_hub_ggufinunsloth/save.pywith the updatedunsloth_zoo/llama_cpp.py, which now builds and installs llama.cpp components into~/.unsloth/llama.cppinstead of the current working directory.Changes
LLAMA_CPP_DEFAULT_DIRandIS_WINDOWSfromunsloth_zoo.llama_cppto reference the correct llama.cpp install pathsave_pretrained_ggufto useos.path.joinwith platform-correct binary locations (build/bin/Release/on Windows, root dir on Linux) and.exesuffix on Windowssave_to_ggufto provide platform-appropriate manual build instructions (cmakeon Windows,makeon Linux)push_to_hub_ggufto use platform-neutral binary names without hardcoded path prefixesWhat did NOT change
The core GGUF conversion logic (
save_to_gguf→check_llama_cpp/install_llama_cpp/convert_to_gguf/quantize_gguf) already delegates tounsloth_zoo.llama_cppfunctions, which transparently pick up the new~/.unsloth/llama.cpppath. No logic changes were needed — only user-facing strings.Related