Skip to content

Commit

Permalink
Added check if reuse_cache supported by selected model_type (huggingf…
Browse files Browse the repository at this point in the history
  • Loading branch information
iermolae authored Feb 2, 2024
1 parent 93264ba commit 4077355
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions optimum/habana/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ def generate(
if model_kwargs["reduce_recompile"]:
assert generation_config.bucket_size
if generation_config.reuse_cache:
assert self.config.model_type in ["llama"], "reuse_cache only supported by llama at the moment"
assert generation_config.bucket_size <= 0, "reuse_cache and bucketing flags set together"

if generation_config.static_shapes:
Expand Down

0 comments on commit 4077355

Please sign in to comment.