Skip to content
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
4 changes: 2 additions & 2 deletions examples/transformers/peft/lora/Qwen2.5-7B-Instruct-Lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def process_func(example):
# 配置训练参数
args = TrainingArguments(
output_dir="./output/Qwen2.5_instruct_lora",
per_device_train_batch_size=3,
per_device_train_batch_size=2,
gradient_accumulation_steps=5,
logging_steps=10,
num_train_epochs=3,
save_steps=100,
save_steps=100,
learning_rate=1e-4,
save_on_each_node=True,
# gradient_checkpointing=True
Expand Down
10 changes: 9 additions & 1 deletion mindnlp/core/_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
from mindspore._c_expression import typing
from mindspore._c_expression.typing import Type

from .configs import ON_A1
from .configs import ON_A1, SUPPORT_BF16

if SUPPORT_BF16:
from mindspore.common.np_dtype import bfloat16 as np_bfloat16# pylint: disable=import-error
else:
from ml_dtypes import bfloat16 as np_bfloat16

bool_alias = bool

Expand Down Expand Up @@ -107,6 +112,9 @@ def __gt__(self, other):
float64 : np.float64,
}

if not ON_A1:
dtype2np[bfloat16] = np_bfloat16

py2dtype = {
bool_alias: bool
}
Loading