Finish the test for model load and save

This commit is contained in:
Qingru Zhang
2023-03-30 06:19:45 +00:00
committed by zqingru
parent e3b4cd4671
commit d4292300a0
3 changed files with 7 additions and 14 deletions
@@ -20,7 +20,7 @@ text_column = "sentence"
label_column = "text_label"
max_length = 128
lr = 1e-3
num_epochs = 2
num_epochs = 8
batch_size = 8
@@ -28,7 +28,7 @@ batch_size = 8
peft_config = AdaLoraConfig(
init_r=12, target_r=8,
beta1=0.85, beta2=0.85,
tinit=2, tfinal=300, deltaT=10,
tinit=200, tfinal=1000, deltaT=10,
lora_alpha=32, lora_dropout=0.1,
task_type=TaskType.SEQ_2_SEQ_LM,
inference_mode=False
@@ -37,7 +37,6 @@ peft_config = AdaLoraConfig(
model = AutoModelForSeq2SeqLM.from_pretrained(model_name_or_path)
model = get_peft_model(model, peft_config)
model.print_trainable_parameters()
model
# loading dataset
@@ -53,8 +52,6 @@ dataset = dataset.map(
num_proc=1,
)
dataset["train"][0]
# data preprocessing
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)