Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for AutoModelForSeq2SeqLM #16

Closed
janpf opened this issue Apr 25, 2023 · 2 comments
Closed

Support for AutoModelForSeq2SeqLM #16

janpf opened this issue Apr 25, 2023 · 2 comments

Comments

@janpf
Copy link

janpf commented Apr 25, 2023

Hi,

Nice library, thanks for your work :)

As far as I understand the code it natively supports AutoModelForCausalLM (decoder only models), but currently does not handle AutoModelForSeq2SeqLM (Encoder+Decoder models), right?

Conceptionally they shouldn't be that different to implement from AutoModelForCausalLM, but would be cool for my use case. Are they on the roadmap, or could you possibly give me some hints on which pitfalls to avoid when trying to patch it in myself? E.g. how to keep the gradients for the encoder etc.

Thanks!

@voidful
Copy link
Owner

voidful commented Apr 25, 2023

Hi

You can check flan-t5 in README, it is Seq2SeqLM model.
https://github.com/voidful/TextRL#example---flan-t5

colab example:
https://colab.research.google.com/drive/1DYHt0mi6cyl8ZTMJEkMNpsSZCCvR4jM1?usp=sharing

@janpf
Copy link
Author

janpf commented Apr 25, 2023

Oh sorry, I missed that. I only scanned the imports and it looked like the FlanT5 is used as a decoder-only architecture 👀

from transformers import AutoModelForCausalLM, AutoTokenizer
[...]
model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")

Thanks for your quick reply, looks promising :)

@janpf janpf closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants