Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatible with MindSpore2.3 #30

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python set_up.py bdist_wheel

执行以下命令安装whl包:
```shell
pip install dist/mindpet-1.0.0-py3-none-any.whl
pip install dist/mindpet-1.0.4-py3-none-any.whl
```


Expand Down
8 changes: 7 additions & 1 deletion mindpet/delta/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
from mindpet.utils.version_control import get_dropout


def check_dense_input_shape(x, prim_name=None):
msg_prefix = f"For '{prim_name}', the" if prim_name else "The"
if len(x) < 2:
raise ValueError(f"{msg_prefix} dimension of 'x' should not be less than 2, but got {len(x)}.")


class LoRADense(nn.Dense):
"""Define a dense layer with LoRA structure.

Expand Down Expand Up @@ -86,7 +92,7 @@ def construct(self, input_tensor):

# Shape operations
x_shape = self.shape_op(input_tensor)
nn.layer.basic.check_dense_input_shape(x_shape, self.cls_name)
check_dense_input_shape(x_shape, self.cls_name)
input_tensor = self.reshape(input_tensor, (-1, x_shape[-1]))

# Dense result
Expand Down
2 changes: 1 addition & 1 deletion set_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def get_version():
version = '1.0.3'
version = '1.0.4'
return version


Expand Down
Loading