peft
peft copied to clipboard
PeftModelForSeq2SeqLM.generate() does not accept positional arguments
This is easy to fix; I will submit a pull request ASAP.
Traceback (most recent call last):
[..]
out = model.generate(
TypeError: PeftModelForSeq2SeqLM.generate() takes 1 positional argument but 2 were given
@pminervini yes, AFAIK to call generate you need to give explicit key word arguments; input_ids=input_ids, attention_mask=attention_mask, etc.
For reference this is what we do in tests: https://github.com/huggingface/peft/blob/542f2470e7679768f594692fc7f59e83f48585a8/tests/test_peft_model.py#L177
For reference this is what we do in tests: https://github.com/huggingface/peft/blob/542f2470e7679768f594692fc7f59e83f48585a8/tests/test_peft_model.py#L177
If you folks want things to stay this way, I can close the issue!
cc @pacman100 !
Hello, @pminervini, it would be great to support positional args too if that can be done in a clean way. Looking forward to your PR.
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.