Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,8 @@ def _prepare_generation_config(
# `cache_implementation="hybrid"` (the static sliding window cache). For these models, we now want to use
# the dynamic sliding window cache by default, so we UNSET `cache_implementation` if it is a default value.
# (if we're inside this branch, then it is because we're using default values from the Hub)
if generation_config.cache_implementation == "hybrid":
# Only unset when the value comes from the model's default config, not when explicitly passed by the user.
if "cache_implementation" not in kwargs and generation_config.cache_implementation == "hybrid":
generation_config.cache_implementation = None

# It doesn't make sense to allow kwargs and `generation_config`, that should be mutually exclusive
Expand Down
Loading