PeftModel => get_pefT_model()

This commit is contained in:
Sayak Paul
2023-02-09 13:34:21 +05:30
parent c7b744db79
commit 14a293a6b3
2 changed files with 14955 additions and 14956 deletions
File diff suppressed because one or more lines are too long
@@ -404,7 +404,7 @@
"This involves two steps:\n",
"\n",
"* Defining a config with `LoraConfig`\n",
"* Wrapping the original `model` with `PeftModel` with the config defined in the step above. "
"* Wrapping the original `model` with `get_peft_model()` with the config defined in the step above. "
]
},
{
@@ -431,7 +431,7 @@
}
],
"source": [
"from peft import LoraConfig, PeftModel\n",
"from peft import LoraConfig, get_peft_model\n",
"\n",
"config = LoraConfig(\n",
" r=32,\n",
@@ -441,7 +441,7 @@
" bias=\"lora_only\",\n",
" modules_to_save=[\"decode_head\"],\n",
")\n",
"lora_model = PeftModel(model, config)\n",
"lora_model = get_peft_model(model, config)\n",
"print_trainable_parameters(lora_model)"
]
},