Fix attn_implementation documentation#29295
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
@fxmarty I don't think this is quite right - if someone can pass in they should also be able to pass it in for the config constructor and then pass that to the model |
|
@amyeroberts This is not what was suggested in #26572 (comment) by @patrickvonplaten. Happy to change that, but I think it should be in an other PR. This PR simply reflects in the documentation the current expected usage by users: model = AutoModel.from_config(cfg, attn_implementation="eager")
model = LlamaModel.from_pretrained("xxx", attn_implementation="eager")while the following is illegal/not supported: from transformers import AutoModelForCausalLM, AutoConfig, LlamaForCausalLM
cfg = AutoConfig.from_pretrained("fxmarty/tiny-llama-fast-tokenizer")
cfg.attn_implementation = "eager"
model = LlamaForCausalLM(cfg)
Ultimately I agree with you, |
|
@fxmarty OK, thanks for explaining and linking to the relevant comment! If it's something that causes a lot of confusion we can circle back on enabling it through the config creation |
amyeroberts
left a comment
There was a problem hiding this comment.
Thanks for following up on this and making the docstrings consistent!
As reported in #26572 (comment),
attn_implementationis wrongfully documented underPretrainedConfig, and is not underAutoModel.from_config&PreTrainedModel.from_pretrainedas it should be.