alpaca-lora icon indicating copy to clipboard operation
alpaca-lora copied to clipboard

countered crash while fine-tuning

Open Hazingoo opened this issue 1 year ago • 1 comments

Traceback (most recent call last): File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\transformers\modeling_utils.py", line 442, in load_state_dict return torch.load(checkpoint_file, map_location="cpu") File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\torch\serialization.py", line 797, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "C:\Users\hazin\anaconda3\envs\finetune\lib\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 "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\transformers\modeling_utils.py", line 446, in load_state_dict if f.read(7) == "version": File "C:\Users\hazin\anaconda3\envs\finetune\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1427: character maps to

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\hazin\Desktop\Projects\AI-lab\try_1\alpaca-lora\finetune.py", line 276, in fire.Fire(train) File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\fire\core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "C:\Users\hazin\Desktop\Projects\AI-lab\try_1\alpaca-lora\finetune.py", line 110, in train model = LlamaForCausalLM.from_pretrained( File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\transformers\modeling_utils.py", line 2736, in from_pretrained ) = cls._load_pretrained_model( File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\transformers\modeling_utils.py", line 3050, in _load_pretrained_model state_dict = load_state_dict(shard_file) File "C:\Users\hazin\anaconda3\envs\finetune\lib\site-packages\transformers\modeling_utils.py", line 458, in load_state_dict raise OSError( OSError: Unable to load weights from pytorch checkpoint file for 'C:\Users\hazin/.cache\huggingface\hub\models--decapoda-research--llama-7b-hf\snapshots\5f98eefcc80e437ef68d457ad7bf167c2c6a1348\pytorch_model-00010-of-00033.bin' at 'C:\Users\hazin/.cache\huggingface\hub\models--decapoda-research--llama-7b-hf\snapshots\5f98eefcc80e437ef68d457ad7bf167c2c6a1348\pytorch_model-00010-of-00033.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

This error message suggests that there was a problem with loading the weights from a PyTorch checkpoint file for a model called LlamaForCausalLM. The error occurred while trying to read a zip archive that contains the weights, and there was an issue with finding the central directory. Additionally, there was a UnicodeDecodeError caused by a character encoding issue.

It is possible that the checkpoint file is corrupt or inaccessible.

Hazingoo avatar Apr 11 '23 08:04 Hazingoo

i meet the same problem,did you fix it?

justabugg avatar Apr 16 '23 04:04 justabugg