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
Fix prefix formatting #885
Conversation
|
||
|
||
def format_pair(pair): | ||
return "{} {} {}".format(QA_SPECIAL_TOKENS["Question"], pair[0], QA_SPECIAL_TOKENS["Answer"]), pair[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can make this into
-+ return "{}{}{}".format(QA_SPECIAL_TOKENS["Question"], pair[0], QA_SPECIAL_TOKENS["Answer"]), pair[1]
Not sure how all the tokenizer handle spaces for the models we have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProsocialDialogue and SODA should also have the format_parirs
@sanagno I added the prefix token in the preprocess phase, so there's no reason to add during get_item |
Thanks, looks great |
Move question and answer token to formatting.py and added in dataset phase instead of collator. This fix soda and prosocial dialogue which previously added the prefix as follow:
dataset with prefix (soda, prosocial_dialogue) should now be as follow :