Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Nov 22, 2024
1 parent 69b2cf1 commit 7d435ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/models/auto/test_modeling_tf_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ def test_cached_model_has_minimum_calls_to_head(self):
self.assertEqual(counter["HEAD"], 1)
self.assertEqual(counter.total_calls, 1)

# very strange stuff!
with RequestCounter() as counter:
pass
if (counter["GET"] != 0 or counter["HEAD"] != 0 or counter.total_calls != 0):
msg = counter._log
import pytest
pytest.fail(str(msg))

# With a sharded checkpoint
_ = TFAutoModel.from_pretrained("ArthurZ/tiny-random-bert-sharded")
with RequestCounter() as counter:
Expand Down

0 comments on commit 7d435ea

Please sign in to comment.