Skip to content

Commit 1083964

Browse files
authored
Testing common uses situational HF_HUB_OFFLINE (huggingface#2490)
Employ offline mode when the model was already accessed once from the hub in order to speed up the CI and make the process less prone to rate limiting. The idea here is that we can mark contexts that, once they were visited once for a specific model id, we can assume that they are cached locally and can set HF_HUB_OFFLINE=1 for this context. This PR tests this concept for testing_common which is already a big chunk of the tests and probably has the biggest gain given the amount of change. We already saw that the assumption does not always hold true: for the prompt tuning tests (_test_prepare_input_for_generation) there is a case where one time the tokenizer is not used for model X and after that time the tokenizer is used - since we're setting the hub to offline for the second time the tokenizer from_pretrained call will fail. This problem is alleviated by adding the tokenizer name to the model id as cache identifier.
1 parent 3a67a44 commit 1083964

File tree

1 file changed

+900
-799
lines changed

1 file changed

+900
-799
lines changed

0 commit comments

Comments
 (0)