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.3.tar.gz (203.6 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.3-py3-none-any.whl (214.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patchs_unsloth_llamacpp-0.0.3.tar.gz
  • Upload date:
  • Size: 203.6 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.3.tar.gz
Algorithm Hash digest
SHA256 f1cbad13b9de5ba5ad718129d69be181ede1870dda8ab8db817645b395297e6e
MD5 a0f18a829e2f5ce205804d51207e5426
BLAKE2b-256 6386c1f58190d6eb67e16241d660a4e23dd20a3ab10cf0bb5a1b2c2c328e1224

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for patchs_unsloth_llamacpp-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b56ec73eab137e70fb623be0b47825ac7c59a1f840689d8faa66840c955cdec1
MD5 1d90693a7acdc23c098d6a360eef0b3f
BLAKE2b-256 a25a7bdab2bb8832c36b47d2c06c33b46dd55f0895bf62a3731275800d14be6c

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