Cache: init empty cache when use_cache (#34274)

* fix

* fix tests

* fix copies

* add docs

* Revert "add docs"

This reverts commit 32d35634f12ba02781d2ebdee0c8dcfbe992a7b9.

* qwen move deltas

* mllama can potentiall fullgraph compile

* enable mllama compile and fix tests

* remove mllama fixes
This commit is contained in:
Raushan Turganbay
2024-11-25 10:11:33 +01:00
committed by GitHub
parent 1339a14dca
commit c1a8520419
7 changed files with 57 additions and 64 deletions

View File

@@ -2343,7 +2343,8 @@ class ModelTesterMixin:
recursive_check(tuple_iterable_value, dict_iterable_value)
elif tuple_object is None:
return
else:
# model might return non-tensors objects (e.g. Cache class)
elif isinstance(tuple_object, torch.Tensor):
self.assertTrue(
torch.allclose(
set_nan_tensor_to_zero(tuple_object), set_nan_tensor_to_zero(dict_object), atol=1e-5