Open SulRash opened 3 months ago
Hi @SulRash!
Thank you for your pull request and welcome to our community.
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed
. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
@yucu @vivekmig @aobo-y could you check this pull request out, it's only a few lines worth of change :) let me know if I should change anything
Thanks for adding this @SulRash , this looks great! From the CI results, it looks like the lint / ufmt checks are failing, would you be able to resolve that?
Also, ideally we can add the same argument to LLMGradientAttribution for consistency, but we can add that in a separate PR as well.
Thanks again for the contribution!
Hey @vivekmig! Oh yeah, that's actually such a good idea, I'll submit a separate PR request for that class!
Just fixed the linting issue, should be fine now :)
Some models do not generate a bos, so when trying to attribute a single token the code crashes. I added a
skip_bos
argument (that defaults to True to not change anything in the system) and some minor error handling to tell the user when to use the argument.Here's my error handling so far:
This allowed me to attribute multiple choice question answers (a single token) with models (like microsoft/Phi-3-mini-4k-instruct) that don't generate a bos token when the target is predefined.
The error that would pop up without this change is the following: