LoRA: Low-Rank Adaptation of Large Language Models
Paper
•
2106.09685
•
Published
•
58
This model is a LoRA fine-tuned version of BigScience’s BLOOM-7B1 model, trained on a dataset of English quotes. The goal was to adapt BLOOM using the PEFT (Parameter-Efficient Fine-Tuning) approach with LoRA, making it lightweight to train and efficient for deployment.
bigscience/bloom-7b1; LoRA adapters are MIT-compatible)The model can be used for text generation and tagging based on quote-like prompts. For example, you can input a quote, and the model will generate descriptive tags.
Abirate/english_quotes) is relatively small, so the model may overfit and generalize poorly outside similar data.Users should:
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "Jay24-AI/bloom-7b1-lora-tagger"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)
batch = tokenizer("“The only way to do great work is to love what you do.” ->: ", return_tensors='pt')
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=50)
print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=True))
quote and its corresponding tags.quote and tags into a single text string: <quote> ->: <tags>AutoTokenizer from bigscience/bloom-7b1.datasets.map with batched=True."quote ->: tags" format.DataCollatorForLanguageModeling with mlm=False (causal LM objective).r: 8lora_alpha: 16lora_dropout: 0.05bias: "none"task_type: "CAUSAL_LM"per_device_train_batch_size: 2gradient_accumulation_steps: 2warmup_steps: 100max_steps: 50learning_rate: 2e-4fp16: Truelogging_steps: 1output_dir: outputs/bitsandbytes.model.config.use_cache = False during training to suppress warnings.lm_head modified to output FP32 for stability.| Hyperparameter | Value |
|---|---|
| Base model | bigscience/bloom-7b1 |
| Adapter method | LoRA (via PEFT) |
| LoRA r | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0.05 |
| Bias | none |
| Task type | Causal LM |
| Batch size (per device) | 2 |
| Gradient accumulation steps | 2 |
| Effective batch size | 4 |
| Warmup steps | 100 |
| Max steps | 50 |
| Learning rate | 2e-4 |
| Precision | fp16 (mixed precision) |
| Quantization | 8-bit (bitsandbytes) |
| Logging steps | 1 |
| Output directory | outputs/ |
| Gradient checkpointing | Enabled |
| Use cache | False (during training) |
print_trainable_parameters).os.environ["CUDA_VISIBLE_DEVICES"]="0"; specific GPU model not specified, e.g., A100, T4, V100).nf8 type, torch.float16 compute dtype.Abirate/english_quotes).Carbon emissions can be estimated using the Machine Learning Impact calculator.
If you use this model, please cite:
@misc{jay24ai2025bloomlora,
title={LoRA Fine-Tuned BLOOM-7B1 for Quote Tagging},
author={Jay24-AI},
year={2025},
howpublished={\url{https://huggingface.co/Jay24-AI/bloom-7b1-lora-tagger}}
}
For questions or issues, contact the maintainer via Hugging Face discussions: https://huggingface.co/Jay24-AI/bloom-7b1-lora-tagger/discussions