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:
-
Install the python package:
python3 -m pip install patchs_unsloth_llamacpp
-
Add code below in you project:
# use code below before import unsloth and unsloth-zoo from patchs_unsloth_llamacpp import patch patch("GRPO")
-
Run your project:
python3 your_project.py -
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1cbad13b9de5ba5ad718129d69be181ede1870dda8ab8db817645b395297e6e
|
|
| MD5 |
a0f18a829e2f5ce205804d51207e5426
|
|
| BLAKE2b-256 |
6386c1f58190d6eb67e16241d660a4e23dd20a3ab10cf0bb5a1b2c2c328e1224
|
File details
Details for the file patchs_unsloth_llamacpp-0.0.3-py3-none-any.whl.
File metadata
- Download URL: patchs_unsloth_llamacpp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 214.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b56ec73eab137e70fb623be0b47825ac7c59a1f840689d8faa66840c955cdec1
|
|
| MD5 |
1d90693a7acdc23c098d6a360eef0b3f
|
|
| BLAKE2b-256 |
a25a7bdab2bb8832c36b47d2c06c33b46dd55f0895bf62a3731275800d14be6c
|