This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |