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
Describe the bug/ 问题描述 (Mandatory / 必填)
A clear and concise description of what the bug is.
使用mindnlp0.4.1加载模型报错
RuntimeError: Unsupported data type!
----------------------------------------------------
- C++ Call Stack: (For framework developers)
----------------------------------------------------
mindspore/ccsrc/pybind_api/ir/tensor_py.cc:361 MakeTensorOfNumpy
Hardware Environment(Ascend/GPU/CPU) / 硬件环境:
Please delete the backend not involved / 请删除不涉及的后端:
/device ascend/GPU/CPU/kirin/等其他芯片
Ascend: 1*ascend-snt9b1|ARM: 24核 192GB
Software Environment / 软件环境 (Mandatory / 必填):
-- MindSpore version (e.g., 1.7.0.Bxxx) :
-- Python version (e.g., Python 3.7.5) :
-- OS platform and distribution (e.g., Linux Ubuntu 16.04):
-- GCC/Compiler version (if compiled from source):
Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
/mode graph
PyNative
To Reproduce / 重现步骤 (Mandatory / 必填)
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
!export HF_ENDPOINT=http://hf.co
import os
import mindspore
from mindnlp.transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from mindnlp.peft import get_peft_config, get_peft_model, get_peft_model_state_dict, PromptTuningConfig, TaskType
from mindnlp.dataset import load_dataset, BaseMapFunction
from mindspore.dataset import GeneratorDataset
from mindnlp.core import ops, optim
import numpy as np
from threading import Lock
from mindnlp.transformers.optimization import get_linear_schedule_with_warmup
from tqdm import tqdm
from mindnlp.peft.tuners.prompt_tuning.config import PromptTuningInit
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ['HF_ENDPOINT'] = 'http://hf-mirror.com'
if "RANK_TABLE_FILE" in os.environ:
del os.environ["RANK_TABLE_FILE"]
# model_name_or_path = "t5-large"
# tokenizer_name_or_path = "t5-large"
model_name_or_path = "google-t5/t5-large"
tokenizer_name_or_path = "google-t5/t5-large"
checkpoint_name = "financial_sentiment_analysis_prompt_tuning_v1.ckpt"
text_column = "sentence"
label_column = "text_label"
max_length = 128
lr = 1e-3
num_epochs = 8
batch_size = 8
# creating model
peft_config = PromptTuningConfig(
task_type=TaskType.SEQ_2_SEQ_LM,
prompt_tuning_init=PromptTuningInit.TEXT,
num_virtual_tokens=20,
prompt_tuning_init_text="What is the sentiment of this article?\n",
inference_mode=False,
tokenizer_name_or_path=model_name_or_path,
)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name_or_path)
model = get_peft_model(model, peft_config)
model.print_trainable_parameters()
Expected behavior / 预期结果 (Mandatory / 必填)
A clear and concise description of what you expected to happen.
torch输出结果
Describe the bug/ 问题描述 (Mandatory / 必填)
A clear and concise description of what the bug is.
使用mindnlp0.4.1加载模型报错
Ascend
/GPU
/CPU
) / 硬件环境:Ascend: 1*ascend-snt9b1|ARM: 24核 192GB
-- MindSpore version (e.g., 1.7.0.Bxxx) :
-- Python version (e.g., Python 3.7.5) :
-- OS platform and distribution (e.g., Linux Ubuntu 16.04):
-- GCC/Compiler version (if compiled from source):
Python 3.9.10
mindspore 2.3.1
mindnlp 0.4.1
PyNative
/Graph
):PyNative
To Reproduce / 重现步骤 (Mandatory / 必填)
Steps to reproduce the behavior:
Expected behavior / 预期结果 (Mandatory / 必填)
A clear and concise description of what you expected to happen.
torch输出结果
Screenshots/ 日志 / 截图 (Mandatory / 必填)
If applicable, add screenshots to help explain your problem.
Additional context / 备注 (Optional / 选填)
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: