Closed w179962443 closed 11 months ago
I have the same issue with you
Hi @w179962443 @heheda166 ,
Thanks for reporting the error! We've fixed this error and uploaded the correct delta weights of our 13B model. Please re-download the delta weights at https://huggingface.co/FreedomIntelligence/HuatuoGPT-13b-delta.
Best, Junying
~@jymChen The 7B model has the similar bug. (commit 67f0603659ec598cb72c700fa15434408488f7bd in the 🤗 model repo)~ Sorry. One of my downloaded ckpt file is incomplete. It is difficult to download files from 🤗 recently. 😥
root@instance:/home/wy/HuatuoGPT-main# python apply_delta.py --base-model-path /data/nvme0/model/llama-13b-hf --target-model-path /data/nvme0/wy/huatuo-13b_converted --delta-path /data/nvme0/wy/HuatuoGPT-13B Loading the base model from /data/nvme0/model/llama-13b-hf Setting ds_accelerator to cuda (auto detect) Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████| 3/3 [00:12<00:00, 4.15s/it] Loading the delta from /data/nvme0/wy/HuatuoGPT-13B Loading checkpoint shards: 0%| | 0/7 [00:00<?, ?it/s] Traceback (most recent call last): File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/transformers/modeling_utils.py", line 463, in load_state_dict return torch.load(checkpoint_file, map_location="cpu") File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/torch/serialization.py", line 797, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/torch/serialization.py", line 283, in init super().init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/transformers/modeling_utils.py", line 467, in load_state_dict if f.read(7) == "version": File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 128: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "apply_delta.py", line 40, in
apply_delta(args.base_model_path, args.target_model_path, args.delta_path)
File "apply_delta.py", line 18, in apply_delta
delta = AutoModelForCausalLM.from_pretrained(delta_path, torch_dtype=torch.float16, low_cpu_mem_usage=True)
File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 484, in from_pretrained
return model_class.from_pretrained(
File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2881, in from_pretrained
) = cls._load_pretrained_model(
File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/transformers/modeling_utils.py", line 3214, in _load_pretrained_model
state_dict = load_state_dict(shard_file)
File "/data/nvme0/lg/anaconda3/envs/belle/lib/python3.8/site-packages/transformers/modeling_utils.py", line 479, in load_state_dict
raise OSError(
OSError: Unable to load weights from pytorch checkpoint file for '/data/nvme0/wy/HuatuoGPT-13B/pytorch_model-00001-of-00007.bin' at '/data/nvme0/wy/HuatuoGPT-13B/pytorch_model-00001-of-00007.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.