LoRA finetuning code for ChatGLM-6b
Top 48.8% on sourcepulse
This repository provides code for fine-tuning the ChatGLM-6b language model using Low-Rank Adaptation (LoRA). It targets researchers and developers looking to efficiently adapt large language models for specific tasks with reduced computational resources. The primary benefit is enabling fine-tuning on consumer-grade hardware, specifically mentioning an RTX 3090 with 24GB of GPU memory.
How It Works
The project leverages the LoRA technique, which injects trainable low-rank matrices into the existing model weights. This significantly reduces the number of trainable parameters (0.35% in the example) compared to full fine-tuning, leading to faster convergence and lower memory requirements. The code integrates with Hugging Face's transformers
library and uses accelerate
for multi-GPU and DeepSpeed-accelerated training, supporting ZeRO 2 and ZeRO 3 optimizations.
Quick Start & Requirements
accelerate launch
for training.transformers
, loralib
, accelerate
, deepspeed
. Minimum 24GB GPU memory (RTX 3090 recommended).{'prompt': ..., 'completion': ...}
pairs.Highlighted Details
Maintenance & Community
The repository was last updated around April 2022. There is no explicit mention of active community channels or ongoing maintenance.
Licensing & Compatibility
The repository does not explicitly state a license. The code uses libraries with various licenses (e.g., Hugging Face transformers
typically uses Apache 2.0). Users should verify compatibility for commercial or closed-source use.
Limitations & Caveats
The project appears to be from early 2022, and the ChatGLM-6b model itself might have been superseded. The lack of explicit licensing and recent activity could indicate limited ongoing support or potential compatibility issues with newer library versions.
2 years ago
1 day