Skip to content

Instantly share code, notes, and snippets.

View AlexTMallen's full-sized avatar

Alex Mallen AlexTMallen

  • Seattle, WA
View GitHub Profile
from tqdm import tqdm
import random
import pickle
from openai import OpenAI
import matplotlib.pyplot as plt
import numpy as np
def get_search_problem(list_len, mode):
@AlexTMallen
AlexTMallen / finetuning_old.py
Created October 14, 2023 01:29
Old finetuning code that works with python finetuning_old.py --model-name EleutherAI/pythia-410m --objective pretraining_KL+standard --max-length 50 --n-val 500 --device cuda:6 --device2 cuda:7 --pretraining-max-length 256 --disable-cache --n-epochs 1 --ds-name atmallen/sloppy_addition_AB_1.0_balanced
from argparse import ArgumentParser
from collections import namedtuple
import json
from datasets import DatasetDict, load_dataset, Dataset
from itertools import islice, cycle
from peft import get_peft_model, LoraConfig, TaskType, PeftType
from templates import templatize_ds
from merge_lora import merge_lora
from sklearn.metrics import accuracy_score
from torch.optim import AdamW