nlpyang / PreSumm

code for EMNLP 2019 paper Text Summarization with Pretrained Encoders
MIT License
1.29k stars 465 forks source link

How can i know if i download BERT successfully #245

Closed Li-Evan closed 2 years ago

Li-Evan commented 2 years ago

when i run the code , it appear the following error message

[2022-11-21 11:07:20,908 INFO] loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-pytorch_model.bin from cache at ../temp\aa1ef1aede4482d0dbcd4d52baad8ae300e60902e88fcb0bebdec09afd232066.36ca03ab34a1a5d5fa7bc3d03d55c4fa650fed07220e2eeebc06ce58d0e9a157 Traceback (most recent call last): File "C:\Users\LZP\Desktop\LabCode\ProjectCode\BERTSUM\PreSumm-master\src\train.py", line 146, in train_ext(args, device_id) File "C:\Users\LZP\Desktop\LabCode\ProjectCode\BERTSUM\PreSumm-master\src\train_extractive.py", line 203, in train_ext train_single_ext(args, device_id) File "C:\Users\LZP\Desktop\LabCode\ProjectCode\BERTSUM\PreSumm-master\src\train_extractive.py", line 239, in train_single_ext model = ExtSummarizer(args, device, checkpoint) File "C:\Users\LZP\Desktop\LabCode\ProjectCode\BERTSUM\PreSumm-master\src\models\model_builder.py", line 140, in init self.bert = Bert(args.large, args.temp_dir, args.finetune_bert) File "C:\Users\LZP\Desktop\LabCode\ProjectCode\BERTSUM\PreSumm-master\src\models\model_builder.py", line 121, in init self.model = BertModel.from_pretrained('bert-base-uncased', cache_dir=temp_dir) File "C:\Users\LZP.conda\envs\py39\lib\site-packages\pytorch_transformers\modeling_utils.py", line 539, in from_pretrained state_dict = torch.load(resolved_archive_file, map_location='cpu') File "C:\Users\LZP.conda\envs\py39\lib\site-packages\torch\serialization.py", line 795, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Users\LZP.conda\envs\py39\lib\site-packages\torch\serialization.py", line 1020, in _legacy_load typed_storage._storage._set_from_file( RuntimeError: unexpected EOF, expected 2314995 more bytes. The file might be corrupted.

i want to know if i download BERT successfully.in other words,i want to know the error appear because of i have something wrong when i download BERT or have something wrong in training the model with BERT