A toolkit for fine-tuning, inference, and evaluating GreenBitAI's LLMs.
Project description
Green-Bit-LLM
A toolkit for fine-tuning, inference, and evaluating GreenBitAI's LLMs.
Introduction
This Python package uses the Bitorch Engine for efficient operations on GreenBitAI's Low-bit Language Models (LLMs). It enables high-performance inference on both cloud-based and consumer-level GPUs, and supports full-parameter fine-tuning directly using quantized LLMs. Additionally, you can use our provided evaluation tools to validate the model's performance on mainstream benchmark datasets.
Installation
Using Pip
pip install green-bit-llm
From source
simply clone the repository and install the required dependencies (for Python >= 3.9):
git clone https://github.com/GreenBitAI/green-bit-llm.git
pip install -r requirements.txt
Conda
Alternatively you can also use the prepared conda environment configuration:
conda env create -f environment.yml
conda activate gbai_cuda_lm
Usage
Inference
Please see the description of the Inference package for details.
Evaluation
Please see the description of the Evaluation package for details.
sft
Please see the description of the sft package for details.
Requirements
- Python 3.x
- See
requirements.txt
orenvironment.yml
for a complete list of dependencies
Examples
Simple Generation
Run the simple generation script as follows:
CUDA_VISIBLE_DEVICES=0 python -m inference.sim_gen --model GreenBitAI/Qwen-1.5-1.8B-layer-mix-bpw-3.0 --max-tokens 100 --use-flash-attention-2 --ignore-chat-template
PPL Evaluation
CUDA_VISIBLE_DEVICES=0 python -m evaluation.evaluate --model GreenBitAI/Qwen-1.5-4B-layer-mix-bpw-3.0 --trust-remote-code --eval-ppl --ppl-tasks wikitext2,c4_new,ptb
License
We release our codes under the Apache 2.0 License. Additionally, three packages are also partly based on third-party open-source codes. For detailed information, please refer to the description pages of the sub-projects.
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
Built Distribution
Hashes for green_bit_llm-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f089ac73ececb0d678a965c049d384a8d7619fa6605d4cb248069eba77123daf |
|
MD5 | 13e8ca90dd91a983bd612c09147780f2 |
|
BLAKE2b-256 | bfbb63228864966eee4ff4ee2298fae9a1b2844f4dad2859fab98a2057031994 |