[tokenization] do not push special file (#22657)

* do not push special file

* Update src/transformers/tokenization_utils_base.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

---------

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Arthur 2023-04-07 20:12:36 +02:00 committed by GitHub
parent 117a0f6afa
commit b1b3dc3e52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2163,6 +2163,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
# remove private information
if "name_or_path" in tokenizer_config:
tokenizer_config.pop("name_or_path")
tokenizer_config.pop("special_tokens_map_file", None)
with open(tokenizer_config_file, "w", encoding="utf-8") as f:
out_str = json.dumps(tokenizer_config, indent=2, sort_keys=True, ensure_ascii=False) + "\n"