Unverified Commit fb1c8db7 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Fix AutoTokenizer with subfolder passed (#20110)

parent 6156bffa
...@@ -348,6 +348,7 @@ def get_tokenizer_config( ...@@ -348,6 +348,7 @@ def get_tokenizer_config(
use_auth_token: Optional[Union[bool, str]] = None, use_auth_token: Optional[Union[bool, str]] = None,
revision: Optional[str] = None, revision: Optional[str] = None,
local_files_only: bool = False, local_files_only: bool = False,
subfolder: str = "",
**kwargs, **kwargs,
): ):
""" """
...@@ -383,6 +384,9 @@ def get_tokenizer_config( ...@@ -383,6 +384,9 @@ def get_tokenizer_config(
identifier allowed by git. identifier allowed by git.
local_files_only (`bool`, *optional*, defaults to `False`): local_files_only (`bool`, *optional*, defaults to `False`):
If `True`, will only try to load the tokenizer configuration from local files. 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> <Tip>
...@@ -419,6 +423,7 @@ def get_tokenizer_config( ...@@ -419,6 +423,7 @@ def get_tokenizer_config(
use_auth_token=use_auth_token, use_auth_token=use_auth_token,
revision=revision, revision=revision,
local_files_only=local_files_only, local_files_only=local_files_only,
subfolder=subfolder,
_raise_exceptions_for_missing_entries=False, _raise_exceptions_for_missing_entries=False,
_raise_exceptions_for_connection_errors=False, _raise_exceptions_for_connection_errors=False,
_commit_hash=commit_hash, _commit_hash=commit_hash,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment