Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Fixed T5 and GPT2 related bugs in the hugging_face agents #4648

Closed
wants to merge 4 commits into from

Conversation

michaelsaxon
Copy link

@michaelsaxon michaelsaxon commented Jul 6, 2022

Patch description
Previously T5 dictionary was undefined and elements of the huggingface dictionary agent were uninitialized leading to immediate exceptions in the train step for T5 and at the beginning of the validation step for GPT2 when training using train_model.py and the latest versions of HuggingFace

Testing steps
Verify that python parlai/scripts/train_model.py --m hugging_face/t5 --t multiwoz_v22 --mf ~/t5test --truncate 512 --vstep 150 --max-train-steps 300 and python parlai/scripts/train_model.py --m hugging_face/gpt2 --t multiwoz_v22 --mf ~/gpt2test --truncate 512 --vstep 150 --max-train-steps 300 successfully terminate without exceptions

Other information
As discussed with Kurt and Andrew previously

@klshuster klshuster self-requested a review July 11, 2022 21:02
Copy link
Contributor

@klshuster klshuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

I think this all looks great. However, prior to approving, I do think that your original error actually uncovered the real issue; namely, that we don't define an unk token for GPT2. Could you please additionally modify the Gpt2DictionaryAgent to define self.unk_token?

Presumably you'd just override some of the functionality here

Looking at huggingface, i think we can just set it to <|endoftext|> like the other special tokens.

@github-actions
Copy link

This PR has not had activity in 30 days. Closing due to staleness.

@github-actions github-actions bot added the stale label Aug 12, 2022
@klshuster klshuster added donotreap Avoid automatically marking as stale. and removed stale labels Aug 15, 2022
@klshuster
Copy link
Contributor

Is there any update here?

@facebook-github-bot
Copy link

Hi @michaelsaxon!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

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@fb.com. Thanks!

@klshuster klshuster mentioned this pull request Apr 18, 2023
@klshuster
Copy link
Contributor

closing in favor of #5016

@klshuster klshuster closed this Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed donotreap Avoid automatically marking as stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants