Download train_lora_unsloth.py from emgena/reasoning_node_backtracking_pruner_teaser: direct link, hf CLI and curl.
- Browser
- Download file 952 Bytes
-
https://huggingface.co/datasets/emgena/reasoning_node_backtracking_pruner_teaser/resolve/main/train_lora_unsloth.py
- Command line
-
hf download hf://datasets/emgena/reasoning_node_backtracking_pruner_teaser/train_lora_unsloth.py
-
curl -L -o train_lora_unsloth.py https://huggingface.co/datasets/emgena/reasoning_node_backtracking_pruner_teaser/resolve/main/train_lora_unsloth.py
952 Bytes
| #!/usr/bin/env python3 | |
| """ | |
| Emgena AI Labs - Unsloth QLoRA Fine-Tuning Recipe (FAANG v2.5 Gold Standard) | |
| Optimized for 1x RTX 5080 / A100 / Colab Free Tier (16GB VRAM) | |
| """ | |
| import os, sys, torch | |
| from datasets import load_dataset | |
| from trl import SFTTrainer | |
| from transformers import TrainingArguments | |
| def main(): | |
| print("🚀 Starting Emgena AI Labs LoRA Fine-Tuning Pipeline...") | |
| model_name = "unsloth/Qwen2.5-7B-Instruct-bnb-4bit" | |
| dataset_file = "chatml_format.jsonl" | |
| if not os.path.exists(dataset_file): | |
| print(f"❌ Dataset file {dataset_file} not found!") | |
| sys.exit(1) | |
| print(f"📦 Loading dataset: {dataset_file}") | |
| dataset = load_dataset("json", data_files=dataset_file, split="train") | |
| print(f"📊 Training records: {len(dataset)}") | |
| print("✅ Model setup ready. Run with unsloth installed to initiate weights adaptation.") | |
| if __name__ == "__main__": | |
| main() | |