Open LEAGUEDORA opened 1 year ago
Hi there, any updates on when this PR will be merged? TY!
Hi there, any updates on when this PR will be merged? TY!
No. I don't know when it is going to happen.
I have unrolled the need for auth tokens, you should be fine now. Try the demo code as-is
On Thu, 1 Dec 2022 at 7:39 PM, Boyinapalli Sandeep Dora < @.***> wrote:
Hi there, any updates on when this PR will be merged? TY!
No. I don't know when it is going to happen.
— Reply to this email directly, view it on GitHub https://github.com/PrithivirajDamodaran/Parrot_Paraphraser/pull/37#issuecomment-1333824511, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV6KK25KG6V7M3LY4BES6DWLCWRHANCNFSM6AAAAAARATAF34 . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
-- Sent from a mobile device. Please excuse typos and terse messages.
In my code, I have
self.parrot = Parrot(
use_gpu=torch.cuda.is_available(),
)
and I get the error
self.parrot = Parrot(
File "/usr/local/lib/python3.9/dist-packages/parrot/parrot.py", line 10, in __init__
self.tokenizer = AutoTokenizer.from_pretrained(model_tag, use_auth_token=True)
File "/usr/local/lib/python3.9/dist-packages/transformers/models/auto/tokenization_auto.py", line 560, in from_pretrained
tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/transformers/models/auto/tokenization_auto.py", line 412, in get_tokenizer_config
resolved_config_file = cached_file(
File "/usr/local/lib/python3.9/dist-packages/transformers/utils/hub.py", line 409, in cached_file
resolved_file = hf_hub_download(
File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1054, in hf_hub_download
headers = build_hf_headers(
File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_headers.py", line 117, in build_hf_headers
token_to_send = get_token_to_send(token)
File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_headers.py", line 149, in get_token_to_send
raise EnvironmentError(
OSError: Token is required (`token=True`), but no token found. You need to provide a token or be logged in to Hugging Face with `huggingface-cli login` or `huggingface_hub.login`. See https://huggingface.co/settings/tokens.
Not sure if it matters, but I'm using a poetry project for my project:
parrot = { git = "https://github.com/PrithivirajDamodaran/Parrot_Paraphraser.git", branch = "main" }
Was able to get it work by
from huggingface_hub import login
login(token=HUGGINGFACE_TOKEN)
in my file that imports Parrot!
NameError: name 'HUGGINGFACE_TOKEN' is not defined
NameError: name 'HUGGINGFACE_TOKEN' is not defined
Define a constant with like
HUGGINGFACE_TOKEN = 'YOUR_TOKEN'
Since hugging face has updated their API, you cannot access Parrot models without using an auth token. You may land into this issue
...is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'....
To solve this I added a new parameter called
use_auth_token
.How to get a token from Huggingface 1) Open Hugging Face and register/login with your credentials 2) Nativate to Token settings page and create a
write
permitted access token. 3) Copy the token and pass it as a parameter toParrot
class while initiating.So the updated code will be