From 7a78221f93a7a421f99218d55b807bac1870557d Mon Sep 17 00:00:00 2001 From: Lain <70411813+not-lain@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:58:35 +0100 Subject: [PATCH] update peft code snippet (#1048) this pr fixes #1047 --- packages/tasks/src/model-libraries-snippets.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index bb6ac12c3..3dc520e0c 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -933,10 +933,9 @@ export const peft = (model: ModelData): string[] => { } return [ - `from peft import PeftModel, PeftConfig + `from peft import PeftModel from transformers import AutoModelFor${pefttask} -config = PeftConfig.from_pretrained("${model.id}") base_model = AutoModelFor${pefttask}.from_pretrained("${peftBaseModel}") model = PeftModel.from_pretrained(base_model, "${model.id}")`, ];