Skip to content

Commit cc6e911

Browse files
authored
🐛 disallow downloads for fast tokenizer conversion (#63)
#### Motivation Some of our models are failing internal integration tests where the AutoTokenizer tries to download files even though they exist locally in the cache. #### Modifications This adds the `local_files_only` kwarg to the `.from_pretrained()` call in the fast tokenizer conversion in the launcher, to prevent hf from attempting to download tokenizer files #### Result Local tests show this allows the failing models to successfully load up tokenizers Signed-off-by: Joe Runde <[email protected]>
1 parent a5ac374 commit cc6e911

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

launcher/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ fn save_fast_tokenizer(
828828
format!(
829829
"from transformers import AutoTokenizer; \
830830
AutoTokenizer.from_pretrained(\"{model_name}\", \
831-
revision=\"{revision}\").save_pretrained(\"{save_path}\")"
831+
revision=\"{revision}\", local_files_only=True).save_pretrained(\"{save_path}\")"
832832
)
833833
} else {
834834
format!(

0 commit comments

Comments
 (0)