We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3ca380 commit 6637bacCopy full SHA for 6637bac
1 file changed
src/transformers/tokenization_utils_base.py
@@ -1739,7 +1739,11 @@ def from_pretrained(
1739
if loadable_file_ids and "tokenizer_file" in resolved_vocab_files:
1740
loadable_file_ids.add("tokenizer_file")
1741
loadable_file_ids.intersection_update(resolved_vocab_files)
1742
- if loadable_file_ids and all(resolved_vocab_files[file_id] is None for file_id in loadable_file_ids):
+ if (
1743
+ (local_files_only or is_local)
1744
+ and loadable_file_ids
1745
+ and all(resolved_vocab_files[file_id] is None for file_id in loadable_file_ids)
1746
+ ):
1747
raise OSError(error_message)
1748
1749
return cls._from_pretrained(
0 commit comments