mirror of
https://github.com/wassname/peft.git
synced 2026-09-24 13:40:15 +08:00
PeftModel => get_pefT_model()
This commit is contained in:
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)"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user