Skip to content

Commit

Permalink
text_generation: improve parameters check (huggingface#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonchar authored and Liangyx2 committed Jan 20, 2025
1 parent d37b3cb commit f2d3646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion optimum/habana/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,9 +1062,10 @@ def generate(
)
if model_kwargs["reduce_recompile"]:
assert generation_config.bucket_size
# Below condition checked explicitly since llama supports bucket_internal even without reuse_cache
# Below condition checked explicitly since some models (like llama and gpt_bigcode) support bucket_internal even without reuse_cache
if generation_config.bucket_internal:
assert generation_config.bucket_size >= 0, "please set bucket_size to use bucket_internal"
assert generation_config.use_cache, "please set use_cache flag to use bucket_internal"
if generation_config.reuse_cache:
assert (
self.config.model_type
Expand Down

0 comments on commit f2d3646

Please sign in to comment.