The huggingface backend uses DynamicCache.to_legacy_cache which was removed in transformers v5.
We need to figure out the new method you're supposed to use for getting tensors out of DynamicCache, but for now we can should at least pin transformers==4.57.6.