Skip to content

Instantly share code, notes, and snippets.

View ahoho's full-sized avatar

Alexander Hoyle ahoho

View GitHub Profile
ahoho /
Last active May 7, 2024 04:28
Create a huggingface pipeline with a lora-trained alpaca
from typing import Optional, Any
import torch
from transformers.utils import is_accelerate_available, is_bitsandbytes_available
from transformers import (
ahoho /
Created April 2, 2023 19:35
Convert huggingface model to pytorch checkpoint (modified from alpaca-lora)
# Convert a huggingface LLaMA checkpoint to an (unsharded) pytorch checkpoint
# comes from
import argparse
import json
from pathlib import Path
import torch
import transformers
from transformers import LlamaForCausalLM, LlamaTokenizer # noqa: E402