Closed khalil-Hennara closed 9 months ago
I think the problem related to @ArthurZucker and @stevhliu
It looks like ‘attn_implementation’ is supported in version 4.36. Maybe you need to try it after upgrading the transfromers library version
Yes, as @IYoreI mentions, feel free to upgrade the transformers version!
Thanks @IYoreI , @ArthurZucker for your time
Closing as it's resolved!
System Info
transformers
version: 4.35.2Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1", torch_dtype=torch.float16, attn_implementation="flash_attention_2")
The code line has taken from the official website Mistral TypeError: MistralForCausalLM.init() got an unexpected keyword argument 'attn_implementation'when using
use_flash_attention_2=True
it's work fineExpected behavior
The model should be loaded without error, using flash attention2 in the background.