Skip to content

docs: improve documentation on exporting models from Colab - #4152

Closed
Sagargupta16 wants to merge 2 commits into
unslothai:mainfrom
Sagargupta16:docs/improve-colab-export-guide
Closed

Sagargupta16 wants to merge 2 commits into
unslothai:mainfrom
Sagargupta16:docs/improve-colab-export-guide

Conversation

@Sagargupta16

Copy link
Copy Markdown
Contributor

Summary

  • Adds comprehensive guide at docs/exporting_models_from_colab.md covering all model export methods
  • Documents saving to Google Drive, pushing to HuggingFace Hub, and GGUF export for Ollama/llama.cpp
  • Includes comparison tables for all save methods and quantization options
  • Documents common issues: disk space, credential propagation errors, runtime disconnects
  • Adds link to the new guide from README.md

Closes #1615

What's covered

  1. Save LoRA adapters (fastest, smallest files)
  2. Save merged models (16-bit, 4-bit)
  3. GGUF export with quantization options
  4. Push to HuggingFace Hub (LoRA, merged, GGUF)
  5. Save to Google Drive (with credential error workaround)
  6. Download large files from Colab
  7. Troubleshooting common issues

All code examples verified against the actual Unsloth API in unsloth/save.py.

Add comprehensive guide covering how to save fine-tuned models from Google
Colab, including saving to Google Drive, pushing to Hugging Face Hub, GGUF
export for Ollama/llama.cpp, and downloading large files.

Closes #1615

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings March 4, 2026 02:26
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 significantly enhances the documentation by introducing a dedicated, in-depth guide for exporting fine-tuned models from Google Colab. The new guide aims to provide users with clear, actionable steps and best practices for persisting their models, mitigating the risks associated with Colab's ephemeral environments, and facilitating seamless deployment or sharing across different platforms and formats.

Highlights

  • New Comprehensive Guide: A new guide, 'Exporting Models from Colab', has been added to the documentation, covering all model export methods from Google Colab.
  • Diverse Export Methods Documented: The guide details saving models to Google Drive, pushing to Hugging Face Hub, and exporting to GGUF format for tools like Ollama and llama.cpp.
  • Comparison Tables and Quantization Options: It includes comparison tables for various save methods and a comprehensive list of GGUF quantization options.
  • Troubleshooting Common Issues: The documentation addresses common challenges such as disk space errors, credential propagation issues, and runtime disconnects during large model exports.
  • README Update: The main README.md file has been updated to include a direct link to the new model export guide.
Changelog
  • README.md
    • Added a new link to the 'Exporting Models from Colab' guide under the documentation section.
  • docs/exporting_models_from_colab.md
    • Created a new comprehensive guide on exporting fine-tuned models from Google Colab.
    • Detailed various save methods including LoRA adapters, merged 16-bit models, and GGUF format.
    • Provided instructions for pushing models to Hugging Face Hub, including options for private repositories.
    • Included steps for saving models to Google Drive, along with workarounds for credential errors.
    • Offered methods for downloading large files from Colab, such as file splitting, gdown, and rclone.
    • Addressed common issues and troubleshooting steps for disk space, runtime disconnects, authentication errors, and GGUF conversion failures.
    • Presented quick reference tables comparing save methods and outlining a recommended end-to-end Colab workflow.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds comprehensive documentation on exporting models from Colab, which is a great addition. The new guide is well-structured and covers various methods and troubleshooting steps. I've found a few minor inconsistencies in the code examples that could confuse users. My review includes suggestions to correct directory paths and filenames in the examples to align with the library's behavior, and a minor formatting suggestion to improve the document's structure. Overall, this is a valuable contribution.

Note: Security Review has been skipped due to the limited scope of the PR.

Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a91579fc2b

ℹ️ 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".

Comment thread docs/exporting_models_from_colab.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new end-to-end documentation guide for persisting/exporting fine-tuned Unsloth models from ephemeral Google Colab runtimes, and links it from the project README to address issue #1615.

Changes:

  • Introduces docs/exporting_models_from_colab.md detailing LoRA saves, merged saves, GGUF export/quantization, Hub/Drive workflows, large-file download strategies, and troubleshooting.
  • Adds a README documentation bullet linking to the new Colab export guide.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
docs/exporting_models_from_colab.md New comprehensive Colab export guide (saving/pushing/downloading + troubleshooting).
README.md Adds a documentation link to the new Colab export guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
Comment thread docs/exporting_models_from_colab.md Resolved
- Use ### headings instead of bold text for subheadings
- Fix save_pretrained_gguf argument (use "my_model" not "my_model_gguf")
- Replace hardcoded GGUF filename with <model-name> placeholder

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 847db8cb30

ℹ️ 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".

Comment thread docs/exporting_models_from_colab.md Resolved
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.

[Docs Improvement] Improve documentation on how to export model from Colab

2 participants