Skip to content

Instantly share code, notes, and snippets.

View felixfrohboese's full-sized avatar

Felix Frohboese felixfrohboese

View GitHub Profile
@mlabonne
mlabonne / finetune_llama2.py
Last active January 22, 2025 15:02
Easy Llama 2 fine-tuning script (📝 Article: https://tinyurl.com/finetunellama2)
# Based on younesbelkada/finetune_llama_v2.py
# Install the following libraries:
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy
from dataclasses import dataclass, field
from typing import Optional
import torch
from datasets import load_dataset
from transformers import (