Closed qxpBlog closed 5 months ago
Hi @qxpBlog, thanks for raising!
Please provide a minimal code reproducer that we can run to replicate the error.
cc @gante
I am facing the same error too. The error arises when I call model.generate
method which internally calls the transformers package, specifically from generation/utils.py
. It arises when I call the model.generate method with the larger models (opt-1.3b, llama2) I am using. Does not arise with smaller models like opt-125m. I am using transformers==4.39.3
if generation_config.cache_implementation in NEED_SETUP_CACHE_CLASSES_MAPPING:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError: 'GenerationConfig' object has no attribute 'cache_implementation'
I experienced this same error. After I added the cache_implementation
config I then had an error related to the output_logits
which is why its there too. Was able to fix it with the following code:
gen_conf = GenerationConfig.from_model_config(model.config)
gen_conf.cache_implementation='dynamic'
gen_conf.output_logits = False
# Model parameters can be tuned as desired.
outputs = model.generate(
**inputs,
do_sample=False,
num_beams=5,
max_length=256,
min_length=1,
top_p=0.9,
repetition_penalty=1.5,
length_penalty=1.0,
temperature=1,
generation_config=gen_conf,
)
Hi folks š
I need a short stand-alone script where the issue is clearly reproducible on any computer. Otherwise, it will be hard for me to find out what's wrong :)
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
System Info
Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
I met the following problem, how can i solve it
Expected behavior
AttributeError: 'GenerationConfig' object has no attribute 'cache_implementation'