yangheng95 / PyABSA

Sentiment Analysis, Text Classification, Text Augmentation, Text Adversarial defense, etc.;
https://pyabsa.readthedocs.io
MIT License
923 stars 159 forks source link

Unable to connect to "https://huggingface.co" to load the file "yangheng/deberta-v3-base-absa-v1.1" #354

Open libaimi3270 opened 11 months ago

libaimi3270 commented 11 months ago

Please provide the REQUIRED information. Otherwise, It is almost impossible to locate the problem. DO NOT CHANGE THE FORM.

PYABSA Version (Required)

Python Version:3.9.16
PyABSA Version:2.3.3
Torch Version:1.13.1
Transformers Version:4.33.1

Code To Reproduce (Required)

from pyabsa import ModelSaveOption, DeviceTypeOption
import warnings
warnings.filterwarnings("ignore")
config.batch_size = 16
config.patience = 999
config.log_step = -1
config.seed = [1, 2, 3]
config.verbose = False  # If verbose == True, PyABSA will output the model structure and several processed data examples
config.notice = (
    "This is an training example for aspect term extraction"  # for memos usage
)
trainer = ASTE.ASTETrainer(
    config=config,
    dataset=dataset,
    #from_checkpoint="english", # if you want to resume training from our pretrained checkpoints, you can pass the checkpoint name here
    auto_device=DeviceTypeOption.AUTO,  # use cuda if available
    checkpoint_save_mode=ModelSaveOption.SAVE_MODEL_STATE_DICT,  # save state dict only instead of the whole model
    load_aug=False,  # there are some augmentation dataset for integrated datasets, you use them by setting load_aug=True to improve performance
)

This code is from /PyABSA-2/examples-v2/aspect_sentiment_triplet_extration/Aspect_Sentiment_Triplet_Extraction.ipynb Full Console Output (Required)

[2023-09-25 16:02:59] (2.3.3) Set Model Device: cuda:0
[2023-09-25 16:02:59] (2.3.3) Device Name: NVIDIA RTX A5000
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /yangheng/deberta-v3-base-absa-v1.1/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f089d3bf100>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: a4f17744-40ad-4187-94e4-cb623d1d8900)')' thrown while requesting HEAD https://huggingface.co/yangheng/deberta-v3-base-absa-v1.1/resolve/main/config.json
2023-09-25 16:03:19,652 INFO: PyABSA version: 2.3.3
2023-09-25 16:03:19,656 INFO: Transformers version: 4.33.1
2023-09-25 16:03:19,657 INFO: Torch version: 1.13.1+cu117+cuda11.7
2023-09-25 16:03:19,658 INFO: Device: NVIDIA RTX A5000
2023-09-25 16:03:19,659 INFO: Restaurant14 in the trainer is not a exact path, will search dataset in current working directory
2023-09-25 16:03:19,681 INFO: You can set load_aug=True in a trainer to augment your dataset (English only yet) and improve performance.
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /yangheng/deberta-v3-base-absa-v1.1/resolve/main/tokenizer_config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f089d3c2a30>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 3512b2dd-457f-4528-9674-0f94ea3e2d98)')' thrown while requesting HEAD https://huggingface.co/yangheng/deberta-v3-base-absa-v1.1/resolve/main/tokenizer_config.json
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /yangheng/deberta-v3-base-absa-v1.1/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f089d3c2d30>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 14cb6901-838c-489d-ab73-6e4925bf1d18)')' thrown while requesting HEAD https://huggingface.co/yangheng/deberta-v3-base-absa-v1.1/resolve/main/config.json

Describe the bug

OSError: We couldn't connect to 'https://huggingface.co/' to load this file, couldn't find it in the cached files and it looks like yangheng/deberta-v3-base-absa-v1.1 is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

Expected behavior

I have downloaded the deberta-v3-base-absa-v1.1 file from the website but don't know which folder to put in to run properly.
 Screenshots
![e764ab08be77a853d980a4d5b1a6d07](https://github.com/yangheng95/PyABSA/assets/128564084/dec1dae6-751b-416b-9c7e-ae4f2a58b7f2)
![e764ab08be77a853d980a4d5b1a6d07](https://github.com/yangheng95/PyABSA/assets/128564084/24267df1-666f-4433-a14f-c91a71aeb0f7)
![950356886c5c4b649d48fd60efdb4ae](https://github.com/yangheng95/PyABSA/assets/128564084/e3d2735b-38d7-475c-a01b-b425bcf996da)
Thank you very much for helping me solve the problem!
yangheng95 commented 11 months ago

Please check your downloaded checkpoint, there should be config files and pytorch_model.bin, etc. Then place the folder in the same path with the training script (*.py) and set config.pretrained_bert='path/to/checkpoint'