Skip to content

运行时报错:MoRA/peft-mora/src/peft/tuners/lora /layer.py文件中有俩个小bug #17

@chen-c-alt

Description

@chen-c-alt

修改:
1.在源文件261行前加入:
while pad_size > in_f :
x = torch.cat([x, x[..., :]], dim=-1)
pad_size-=in_f
这是由于没考虑pad_size > in_f得情况导致。

2.在源文件293行代码替换为:
if out_x.numel() == 0:
out_x = out_x.view(*x.shape[:-1], out_f)
else :
out_x = out_x.view(*x.shape[:-1], -1)[..., :out_f]
这是由于未考虑 out_x 中element=0得情况。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions