Skip to content

Commit

Permalink
Fix AutoTokenizer with subfolder passed (huggingface#20110)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger authored and Magnus Pierrau committed Dec 15, 2022
1 parent f3ef472 commit 7939862
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/transformers/models/auto/tokenization_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def get_tokenizer_config(
use_auth_token: Optional[Union[bool, str]] = None,
revision: Optional[str] = None,
local_files_only: bool = False,
subfolder: str = "",
**kwargs,
):
"""
Expand Down Expand Up @@ -383,6 +384,9 @@ def get_tokenizer_config(
identifier allowed by git.
local_files_only (`bool`, *optional*, defaults to `False`):
If `True`, will only try to load the tokenizer configuration from local files.
subfolder (`str`, *optional*, defaults to `""`):
In case the tokenizer config is located inside a subfolder of the model repo on huggingface.co, you can
specify the folder name here.
<Tip>
Expand Down Expand Up @@ -419,6 +423,7 @@ def get_tokenizer_config(
use_auth_token=use_auth_token,
revision=revision,
local_files_only=local_files_only,
subfolder=subfolder,
_raise_exceptions_for_missing_entries=False,
_raise_exceptions_for_connection_errors=False,
_commit_hash=commit_hash,
Expand Down

0 comments on commit 7939862

Please sign in to comment.