Skip to content

Instantly share code, notes, and snippets.

View mlabonne's full-sized avatar

Maxime Labonne mlabonne

View GitHub Profile
import time
from datetime import timedelta
from datasets import load_dataset
from txtai import LLM
from txtai.pipeline import Labels, HFTrainer
def prompt(text):
text = f"""
@mlabonne
mlabonne / YALL - Yet Another LLM Leaderboard.md
Last active July 9, 2024 09:28
Leaderboard made with 🧐 LLM AutoEval (https://github.com/mlabonne/llm-autoeval) using Nous benchmark suite.
@mlabonne
mlabonne / merge_peft.py
Last active July 25, 2024 21:25
Merge base model and peft adapter and push it to HF hub
# Example usage:
# python merge_peft.py --base_model=meta-llama/Llama-2-7b-hf --peft_model=./qlora-out --hub_id=alpaca-qlora
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import argparse
def get_args():