mirror of
https://github.com/wassname/peft.git
synced 2026-09-11 12:30:16 +08:00
addressing comments and renaming pet to peft
This commit is contained in:
+6
-6
@@ -893,8 +893,8 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from pet import get_pet_config, LoRAModel, get_pet_model, LoRAConfig, TaskType\n",
|
||||
"pet_config = LoRAConfig(\n",
|
||||
"from peft import get_peft_config, LoraModel, get_peft_model, LoraConfig, TaskType\n",
|
||||
"peft_config = LoraConfig(\n",
|
||||
" task_type=TaskType.TOKEN_CLS,\n",
|
||||
" inference_mode=False,\n",
|
||||
" r=16,\n",
|
||||
@@ -902,7 +902,7 @@
|
||||
" lora_dropout=0.1,\n",
|
||||
" bias=\"all\"\n",
|
||||
" )\n",
|
||||
"pet_config"
|
||||
"peft_config"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1395,7 +1395,7 @@
|
||||
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
|
||||
"\n",
|
||||
"model = LayoutLMForTokenClassification.from_pretrained(\"microsoft/layoutlm-base-uncased\", num_labels=num_labels)\n",
|
||||
"model = get_pet_model(model, pet_config)\n",
|
||||
"model = get_peft_model(model, peft_config)\n",
|
||||
"model.to(device)"
|
||||
]
|
||||
},
|
||||
@@ -3140,8 +3140,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from pet import get_pet_model_state_dict\n",
|
||||
"to_return = get_pet_model_state_dict(model)\n"
|
||||
"from peft import get_peft_model_state_dict\n",
|
||||
"to_return = get_peft_model_state_dict(model)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
Reference in New Issue
Block a user