LLaVA
LLaVA copied to clipboard
[Usage] TypeError: LlavaLlamaForCausalLM.forward() got an unexpected keyword argument 'cache_position'
Describe the issue
Reference issue https://github.com/huggingface/transformers/issues/29426
I also encountered this error with transformers >4.38.2 when trying new LLavaLama3 from https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-hf/discussions/1 I need to use tranformers > 4.39.2 for my work and llava requires 4.37 which is quite old by now. would it be possible to adjust the code and update it to latest versions?
Hey! This should be solvable by popping the cache_position from inputs in this method.
inputs.pop("cache_position")
The error is raised because calling "super()" returns kwargs that are not used in the custom model's forward.
@zucchini-nlp It works!
This fixed the issue for me as well, thanks!