"git@developer.sourcefind.cn:wuxk1/megatron-lm.git" did not exist on "2eaa3ccc30fd24607cc953b57471225ad48c6ac5"
Unverified Commit 05c1f9af authored by Hanna Yukhymenko's avatar Hanna Yukhymenko Committed by GitHub
Browse files

Check device map for saving tokenizer config on TPU (fix for issue #31971) (#32043)

* Remove TPU device map for saving tokenizer config

* Update tokenization_utils_base.py

* Fix error msg when passing non-string device into tokenizer

* Fix error message for non-string tokenizer device

* Print out tokenizer device type in error msg

* Update tokenization_utils_base.py
parent 9e282840
......@@ -2663,6 +2663,8 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
tokenizer_config.pop("name_or_path")
tokenizer_config.pop("special_tokens_map_file", None)
tokenizer_config.pop("tokenizer_file", None)
if "device_map" in tokenizer_config:
tokenizer_config.pop("device_map")
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"
......
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