Skip to content

Bug Report: RuntimeError in Google Colab Due to Missing llama-quantize Files #2007

Closed

Description

@AbhigyanSrivastav

Description

A recent commit introduced checks for different file extensions (.exe and non-.exe) to support both Linux and Windows environments. However, this change results in a RuntimeError when the required files (llama-quantize, llama-quantize.exe, quantize, or quantize.exe) are not found in the expected directories, causing the llama.cpp installation to fail in Google Colab.

Commit Details

  • Commit: 222b1e7
  • Author: Gennadii Manzhos
  • Date: 2025-02-16
  • Changes:
    • Fixed llama-quantize error on Windows WSL by modifying save.py (fixes GGUF saving issue).
    • Added extension checks for .exe and non-.exe files for Linux and Windows.

Pull Request Details

  • PR: Gemma 3 Bug Fixes
  • Author: Daniel Han
  • Merged by: Daniel Han
  • Files Changed: 7
  • Additions: 224
  • Deletions: 115
  • State: Merged

Error Message

RuntimeError: Unsloth: The file ('llama.cpp/llama-quantize' or 'llama.cpp/llama-quantize.exe' if you are on Windows WSL) or 'llama.cpp/quantize' does not exist. But we expect this file to exist! Maybe the llama.cpp developers changed the name or check extension of the llama-quantize file.

Steps to Reproduce

  1. Install llama.cpp in a Google Colab environment.
  2. Ensure that llama-quantize or quantize files are missing or renamed.
  3. The installation process fails with a RuntimeError.

Expected Behavior

The installation process should complete successfully when the required files are correctly identified and present.

Actual Behavior

The installation fails with a RuntimeError due to missing or misidentified llama-quantize or quantize files in Google Colab.

Additional Information

For reference, please see:

Suggested Fix

Consider modifying the file detection logic to accommodate different execution environments, particularly for Google Colab. A fallback mechanism or a clear warning message with resolution steps would improve usability.

Activity

  1. rolandtannous commented on Oct 15, 2025

    @rolandtannous
    Contributor

    @AbhigyanSrivastav
    We just pushed a major fix for llamacpp integration.

    1- Please make sure to update your local install of unsloth

    pip install --force-reinstall --no-deps unsloth-zoo unsloth
    

    If you're using a notebook on kaggle or colab, it should pull the latest version automatically.

    2- You can now use save_pretrained_gguf to quantize and save to GGUF format:

    model.save_pretrained_gguf(
                save_directory,
                tokenizer=tokenizer,
                quantization_method=quantization_method,
            )
    

    For vision/multimodal models, use tokenizer=processor

    3- You can pass it one or several quant methods (as a list):

    quantization_method = "q8_0"
    

    or

    quantization_method = ["q8_0", "q4_k_m"]
    

    We support all the quants mentioned in this page except the iq variants.

    4- If the model is supported by Ollama, it will now also automatically create a Modelfile for you that you can use to create your model in ollama using:

    ollama create model_name -f ./Modelfile
    

    5- Use push_to_hub_gguf if you want to convert to gguf and push to Huggingface Hub instead.

    6- Should work for all models supported by unsloth and ollama.

    7- It now fully supports linux debian and RPM variants. We are still testing windows (if someone has a windows machine and is on our discord channel ping me to help debug)

    This should now work.
    Let me know how it goes for you.

    Thanks!

  2. rolandtannous commented on Oct 23, 2025

    @rolandtannous
    Contributor

    Will be closing this for now as the issue has been resolved. Please make sure to follow the instructions given in my last response.

    Meanwhile , please feel free to respond if you're still having any issues.

    Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions