Created
January 29, 2026 13:31
-
-
Save davidmezzetti/3c3492732ab46b1afe3d0fca429a462c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from unsloth import FastModel | |
| from datasets import load_dataset | |
| from txtai.pipeline import HFTrainer | |
| # Load training dataset | |
| train = load_dataset(...) | |
| # Full fine-tune (16-bit) | |
| # Set load_in_4bit=True and trainer.lora=True to train a QLoRA model | |
| model = FastModel.from_pretrained(path, full_finetuning=True, | |
| load_in_4bit=False, load_in_16bit=True) | |
| trainer = HFTrainer() | |
| trainer( | |
| model, | |
| train, | |
| task="language-generation", | |
| per_device_train_batch_size=16, | |
| gradient_accumulation_steps=1, | |
| num_train_epochs=1 | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment