Skip to content

Commit

Permalink
merged with main
Browse files Browse the repository at this point in the history
  • Loading branch information
gante committed May 22, 2024
1 parent 39edb53 commit ae17ea4
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,6 @@ def generate(
"This model does not support the `cache_implementation` argument. Please check the following "
"issue: https://github.com/huggingface/transformers/issues/28981."
)
<<<<<<< HEAD
if generation_config.cache_implementation == "static" and not self._supports_static_cache:
raise ValueError(
"This model does not support `cache_implementation='static'`. Please check the following "
Expand All @@ -1634,18 +1633,6 @@ def generate(
model_kwargs["past_key_values"] = self._get_cache(
generation_config.cache_implementation, batch_size, generation_config.max_length
)
=======
if generation_config.cache_implementation == "static":
if not self._supports_static_cache:
raise ValueError(
"This model does not support `cache_implementation='static'`. Please check the following "
"issue: https://github.com/huggingface/transformers/issues/28981"
)
model_kwargs["past_key_values"] = self._get_static_cache(
max_batch_size=batch_size, max_cache_len=generation_config.max_length, device=device
)

>>>>>>> 189ad632c (tmp commit)
self._validate_generated_length(generation_config, input_ids_length, has_default_max_length)

# 7. determine generation mode
Expand Down

0 comments on commit ae17ea4

Please sign in to comment.