You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
我已经搜索过FAQ | I have searched FAQ
当前行为 | Current Behavior
LoRA SFT 得到 adapter 权重后, 使用下面的方法加载权重时报错:
frompeftimportAutoPeftModelForCausalLMmodel=AutoPeftModelForCausalLM.from_pretrained(
# path to the output directory'output/minicpmv2_lora',
device_map="auto",
trust_remote_code=True
).eval()
错误:
Traceback (most recent call last):
File "/MiniCPM-V/minicpm_infer.py", line 17, in <module>
model = AutoPeftModelForCausalLM.from_pretrained(
File "/usr/local/lib/python3.10/dist-packages/peft/auto.py", line 126, in from_pretrained
base_model.resize_token_embeddings(len(tokenizer))
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 1901, in resize_token_embeddings
model_embeds = self._resize_token_embeddings(new_num_tokens, pad_to_multiple_of)
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 1915, in _resize_token_embeddings
old_embeddings = self.get_input_embeddings()
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 1668, in get_input_embeddings
raise NotImplementedError
NotImplementedError
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
当前行为 | Current Behavior
LoRA SFT 得到 adapter 权重后, 使用下面的方法加载权重时报错:
错误:
表现为缺少 get_input_embeddings 函数. 看 finetune.py 中, get_input_embeddings 方法是动态加入的, 是不是这里存在问题?
期望行为 | Expected Behavior
LoRA 权重可以正常加载, 不报错.
复现方法 | Steps To Reproduce
AutoPeftModelForCausalLM
方法加载 adapter 目录, 得到完整的模型运行环境 | Environment
备注 | Anything else?
No response
The text was updated successfully, but these errors were encountered: