-
Notifications
You must be signed in to change notification settings - Fork 516
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
add capability to output intermediate hidden states #451
Conversation
Have you tested this @sarahwie ? Looks close to what I would expect but I don't use the OLMo repo much :) |
Hi @sarahwie this is great! Do you mind also adding the use of the two flags to the HF wrapper here: https://github.com/allenai/OLMo/blob/main/hf_olmo/modeling_olmo.py#L48 |
I've tested this locally but haven't re-built the pip package, let me try that to make sure it still works as expected @natolambert |
Co-authored-by: 玄钛 <[email protected]> Co-authored-by: Pete <[email protected]> Co-authored-by: epwalsh <[email protected]>
Temporarily added code to throw an error if Tested this, and everything is worked as expected. Should I merge? |
Add a functionality that HF model forward calls have.
A very similar update can be done to add the
output_attentions
functionality, though I haven't written it yet.Note that HF code "appends" hidden states to a tuple object, but I'm using a list as I think it's better practice. Hence the type casting in the function output to return a tuple, in order to match expected output in HF's convention.