Describe the bug/ 问题描述 (Mandatory / 必填)
A clear and concise description of what the bug is.
通过mindnlp.transformers.AutoModelForCausalLM加载AI-ModelScope/CodeLlama-7b-Instruct-hf模型时,报错safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge,且已经pip install --upgrade safetensor更新至最新版本
Hardware Environment(Ascend/GPU/CPU) / 硬件环境:
/GPU
Software Environment / 软件环境 (Mandatory / 必填):
-- MindSpore version (e.g., 1.7.0.Bxxx) :2.2.14
-- Python version (e.g., Python 3.7.5) :3.9.19
Expected behavior / 预期结果 (Mandatory / 必填)
A clear and concise description of what you expected to happen.
Screenshots/ 日志 / 截图 (Mandatory / 必填)
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.616 seconds.
Prefix dict has been built successfully.
Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/data1/xuhang/5009_nl2sql/nl2sql_finetuning_ms.py", line 168, in
model = AutoModelForCausalLM.from_pretrained(model_name, mirror="modelscope")
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/models/auto/auto_factory.py", line 509, in from_pretrained
return model_class.from_pretrained(
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/modeling_utils.py", line 2911, in from_pretrained
) = cls._load_pretrained_model(
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/modeling_utils.py", line 3266, in _load_pretrained_model
state_dict = load_state_dict(shard_file, is_quantized=is_quantized)
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/modeling_utils.py", line 435, in load_state_dict
with safe_open(checkpoint_file, framework="np") as f:
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
Describe the bug/ 问题描述 (Mandatory / 必填) A clear and concise description of what the bug is. 通过mindnlp.transformers.AutoModelForCausalLM加载AI-ModelScope/CodeLlama-7b-Instruct-hf模型时,报错safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge,且已经pip install --upgrade safetensor更新至最新版本
Hardware Environment(
Ascend
/GPU
/CPU
) / 硬件环境:Software Environment / 软件环境 (Mandatory / 必填): -- MindSpore version (e.g., 1.7.0.Bxxx) :2.2.14 -- Python version (e.g., Python 3.7.5) :3.9.19
Excute Mode / 执行模式 (Mandatory / 必填)(
PyNative
/Graph
):To Reproduce / 重现步骤 (Mandatory / 必填)
model_name = "AI-ModelScope/CodeLlama-7b-Instruct-hf"
tokenizer = CodeLlamaTokenizer.from_pretrained(model_name, mirror="modelscope")
model = AutoModelForCausalLM.from_pretrained(model_name, mirror="modelscope")
Expected behavior / 预期结果 (Mandatory / 必填) A clear and concise description of what you expected to happen.
Screenshots/ 日志 / 截图 (Mandatory / 必填)
Building prefix dict from the default dictionary ... Loading model from cache /tmp/jieba.cache Loading model cost 0.616 seconds. Prefix dict has been built successfully. Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s] Traceback (most recent call last): File "/data1/xuhang/5009_nl2sql/nl2sql_finetuning_ms.py", line 168, in
model = AutoModelForCausalLM.from_pretrained(model_name, mirror="modelscope")
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/models/auto/auto_factory.py", line 509, in from_pretrained
return model_class.from_pretrained(
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/modeling_utils.py", line 2911, in from_pretrained
) = cls._load_pretrained_model(
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/modeling_utils.py", line 3266, in _load_pretrained_model
state_dict = load_state_dict(shard_file, is_quantized=is_quantized)
File "/data1/xuhang/envs/nl2sql/lib/python3.9/site-packages/mindnlp/transformers/modeling_utils.py", line 435, in load_state_dict
with safe_open(checkpoint_file, framework="np") as f:
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
Additional context / 备注 (Optional / 选填)