Skip to main content

A patch to enable llama.cpp as acceleration backend on windows platform

Project description

patchs_unsloth_llamacpp

Overview

patchs_unsloth_llamacpp is a tool designed to accelerate model inference on the Windows platform using llama.cpp as its backend.

Features

  • Accelerates model inference by llama.cpp.
  • Compatible with Windows operating system.
  • If RAM is not enough, also support move data to VRAM ( this may consume more VRAM ).
  • Only Support GRPOTrainer now.
  • Automatically download latest llama.cpp from github to ./Llama.

Usage Example

To use patchs_unsloth_llamacpp, follow these steps:

  1. Install the python package:

    python3 -m pip install patchs_unsloth_llamacpp
    
  2. Add code below in you project:

    # use code below before import unsloth and unsloth-zoo
    from patchs_unsloth_llamacpp import patch
    patch("GRPO")
    
  3. Run your project:

    python3 your_project.py
    
  4. If RAM is OOM when training, add these code below to move data to VRAM instead.

    from patchs_unsloth_llamacpp import unsloth_cpu_oom_patch
    unsloth_cpu_oom_patch(True)
    

QAs

1. First Run Error

On the initial run, you might encounter an error stating "AttributeError: 'NoneType' object has no attribute 'span'". Simply running the application again should resolve this issue.

2. GGUF Error

As llama.cpp has it own gguf format to save models, this package has its own gguf python package, which may conflicts with other gguf packages installed in the system. If this happens, please uninstall or update guff package installed.

3. Install llama.cpp Error

If something wrong with installing llama.cpp to your project, please shutdown windows defender first ( Windows Defender may determine file risk ) and check the Internet connecting to Github. Or you can Install llama.cpp in Github ( https://github.com/ggml-org/llama.cpp/releases/latest )

Contact Author

For questions or contributions, please contact the author at liuzhi1999@foxmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

patchs_unsloth_llamacpp-0.0.4.tar.gz (203.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patchs_unsloth_llamacpp-0.0.4-py3-none-any.whl (214.3 kB view details)

Uploaded Python 3

File details

Details for the file patchs_unsloth_llamacpp-0.0.4.tar.gz.

File metadata

  • Download URL: patchs_unsloth_llamacpp-0.0.4.tar.gz
  • Upload date:
  • Size: 203.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for patchs_unsloth_llamacpp-0.0.4.tar.gz
Algorithm Hash digest
SHA256 99feb0e408f902c557370cb6a9d9a39b708f1ced888bb410188a39b827f544e1
MD5 a7aa7c076524b6898e89172da9ec0bda
BLAKE2b-256 403f4ece5494c970edcd02c5e32d9f6fc63dab32ed5036ff37732acb8cc88020

See more details on using hashes here.

File details

Details for the file patchs_unsloth_llamacpp-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for patchs_unsloth_llamacpp-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f15d7f3e8d2abfcbc09e36ef52836d9f901407d4373a42144d6da7dcccded7e7
MD5 7be1a51c577cb3e3f2b22335c0d2fcb3
BLAKE2b-256 15c5ef12f53656c7cbdbcf1a223ad3b6eab23f2e40f1869922b7ecb4371fdc1e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page