Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't download models weights #2

Open
dingdongyouarewrong opened this issue Nov 23, 2022 · 2 comments
Open

Can't download models weights #2

dingdongyouarewrong opened this issue Nov 23, 2022 · 2 comments

Comments

@dingdongyouarewrong
Copy link

When I try to run the detoxGPT model from the readme collab, it can't download detoxGPT model weights

from rudetoxifier.models.detoxGPT import detoxGPT

# if you are running the code for the first time, 
# the fine-tuned weights will be downlading, that can take time
model = detoxGPT(device)
Text error output(same as on the pic)
Loading fine-tuned weights.
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name)
    238     try:
--> 239         response.raise_for_status()
    240     except HTTPError as e:

10 frames
HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/rugpt3_large_200/resolve/main/vocab.json

The above exception was the direct cause of the following exception:

RepositoryNotFoundError                   Traceback (most recent call last)
RepositoryNotFoundError: 401 Client Error. (Request ID: iedQ-NZbOy06HPI74u7So)

Repository Not Found for url: https://huggingface.co/rugpt3_large_200/resolve/main/vocab.json.
Please make sure you specified the correct `repo_id` and `repo_type`.
If the repo is private, make sure you are authenticated.
Invalid username or password.

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/transformers/utils/hub.py](https://localhost:8080/#) in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only, subfolder, user_agent, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash)
    423     except RepositoryNotFoundError:
    424         raise EnvironmentError(
--> 425             f"{path_or_repo_id} is not a local folder and is not a valid model identifier "
    426             "listed on '[https://huggingface.co/models'\nIf](https://huggingface.co/models'/nIf) this is a private repository, make sure to "
    427             "pass a token having permission to this repo with `use_auth_token` or log in with "

OSError: rugpt3_large_200 is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass `use_auth_token=True`.

image

the condBERT model also can not be used

import sys
sys.path.append('rudetoxifier/models/condBERT')
sys.path.append('rudetoxifier/models/condBERT/multiword')

from rudetoxifier.models.condBERT import condBERT

# if you are running the code for the first time, 
# the pre-trained weights will be downlading, that can take time
# you can try condBERT with or without fine-tuned weights
model = condBERT(device=device, from_pretrained=True)
Text error output(same as on the pic)
Downloading: 100%
133k/133k [00:00<00:00, 1.51MB/s]
Downloading: 100%
49.0/49.0 [00:00<00:00, 1.25kB/s]
Downloading: 100%
659/659 [00:00<00:00, 11.7kB/s]
Downloading: 100%
388M/388M [00:09<00:00, 40.8MB/s]
Loading fine-tuned weights.
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[<ipython-input-4-6e332c8d6c21>](https://localhost:8080/#) in <module>
      8 # the pre-trained weights will be downlading, that can take time
      9 # you can try condBERT with or without fine-tuned weights
---> 10 model = condBERT(device=device, from_pretrained=True)

3 frames
[/usr/local/lib/python3.7/dist-packages/torch/serialization.py](https://localhost:8080/#) in __init__(self, name, mode)
    209 class _open_file(_opener):
    210     def __init__(self, name, mode):
--> 211         super(_open_file, self).__init__(open(name, mode))
    212 
    213     def __exit__(self, *args):

FileNotFoundError: [Errno 2] No such file or directory: 'ru_cond_bert_geotrend/checkpoint-9000/pytorch_model.bin'

image

@dingdongyouarewrong dingdongyouarewrong changed the title Can't donwload rugpt3_large_200 Can't download models weights Nov 23, 2022
@dardem
Copy link
Collaborator

dardem commented Dec 14, 2022

Hello!

Thank you for the interest in the work.

About condBERT -- apparently, Colab forbids now to download files more than 1Gb with command line. There is a full link to the condBERT weight's:
https://drive.google.com/file/d/1z5UlXYpZPBC0hlP6W8EMdcgCZmpO5lPg/view?usp=share_link

you can upload and unzip the weights in your working folder by yourself.

@dardem
Copy link
Collaborator

dardem commented Dec 19, 2022

About ruGPT3 model for texts detoxification -- unfortunately, the weights for this model are lost. I can recommend to use our new model with way better performance: https://huggingface.co/SkolkovoInstitute/ruT5-base-detox
The example of the usage you can find here: https://github.com/s-nlp/russe_detox_2022/tree/main/baselines/t5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants