Fixing double use_auth_token.pop (preventing private models from being visible). (#24812)

Fixing double `use_auth_token.pop` (preventing private models from
being visible).

Should fix: https://github.com/huggingface/transformers/issues/14334#issuecomment-1634527833

Repro: Have a private repo, with `vocab.json` (spread out files for the
tokenizer) and use `AutoTokenizer.from_pretrained(...,
use_auth_token="token")`.
This commit is contained in:
Nicolas Patry 2023-07-14 15:20:02 +02:00 committed by GitHub
parent 91d7df58b6
commit 50726f9ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1710,7 +1710,6 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
from_auto_class = kwargs.pop("_from_auto", False)
commit_hash = kwargs.pop("_commit_hash", None)
use_auth_token = kwargs.pop("use_auth_token", None)
if use_auth_token is not None:
warnings.warn(
"The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.", FutureWarning