Files
wehub-resource-sync caf324b09d
Build documentation / build (push) Failing after 0s
Deploy "method_comparison" Gradio to Spaces / deploy (push) Has been cancelled
Deploy "PEFT shop" Gradio app to Spaces / deploy (push) Has been cancelled
tests on transformers main / tests (push) Has been cancelled
tests / check_code_quality (push) Has been cancelled
tests / tests (ubuntu-latest, 3.10) (push) Has been cancelled
tests / tests (ubuntu-latest, 3.11) (push) Has been cancelled
tests / tests (ubuntu-latest, 3.12) (push) Has been cancelled
tests / tests (ubuntu-latest, 3.13) (push) Has been cancelled
tests / tests (windows-latest, 3.10) (push) Has been cancelled
tests / tests (windows-latest, 3.11) (push) Has been cancelled
tests / tests (windows-latest, 3.12) (push) Has been cancelled
tests / tests (windows-latest, 3.13) (push) Has been cancelled
Secret Leaks / trufflehog (push) Has been cancelled
CI security linting / zizmor latest via Cargo (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:42 +08:00

21 lines
999 B
Markdown

# GLoRA causal language modeling fine-tuning
This example demonstrates how to fine-tune a causal language model with [GLoRA](https://arxiv.org/abs/2306.07967) adapters using the Alpaca-style instruction data from `yahma/alpaca-cleaned`. GLoRA generalizes LoRA by introducing configurable paths for weight and bias corrections: `W_eff = W0 + W0 * A + B` and `b_eff = b0 + b0 * D + E + W0 @ C`.
## Running the script
```bash
python examples/glora_finetuning/glora_finetuning.py \
--base_model meta-llama/Meta-Llama-3-8B-Instruct \
--data_path yahma/alpaca-cleaned \
--output_dir glora-alpaca \
--glora_r 8 \
--config_A_B lora \
--config_C lora \
--config_D_E constant \
--learning_rate 3e-4 \
--num_epochs 3
```
Each path (`config_A_B`, `config_C`, `config_D_E`) can be set to different parameterization modes (`lora`, `vector`, `constant`, `none`) to trade off expressiveness against parameter count. The default configuration uses `lora` for A/B and C, and `constant` for D/E.