Remove unused code (#36459)

This commit is contained in:
Matt 2025-03-03 18:31:10 +00:00 committed by GitHub
parent 9fe82793ee
commit 6aa9888463
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2012,7 +2012,6 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
# Get files from url, cache, or disk depending on the case
resolved_vocab_files = {}
unresolved_files = []
for file_id, file_path in vocab_files.items():
if file_path is None:
resolved_vocab_files[file_id] = None
@ -2041,12 +2040,6 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
)
commit_hash = extract_commit_hash(resolved_vocab_files[file_id], commit_hash)
if len(unresolved_files) > 0:
logger.info(
f"Can't load following files from cache: {unresolved_files} and cannot check if these "
"files are necessary for the tokenizer to operate."
)
# If one passes a GGUF file path to `gguf_file` there is no need for this check as the tokenizer will be
# loaded directly from the GGUF file.
if all(full_file_name is None for full_file_name in resolved_vocab_files.values()) and not gguf_file: