Closed rguan1 closed 1 year ago
Hi @rguan1!
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!
How do I add the openai dependency? I noticed that the build_website ci/cd is failing because the package is not available?
How do I add the openai dependency? I noticed that the build_website ci/cd is failing because the package is not available?
You would need to change the requirements.txt
file in the top-level repo.
Alternatively, you can do a safe import that instructs a user how to install the openai
package if the user does not have the package available
@klshuster Thanks for responding! Got it. Which of the two options is preferable? Also, I am unfamiliar with safe import. How do you do that?
@klshuster Thanks for responding! Got it. Which of the two options is preferable? Also, I am unfamiliar with safe import. How do you do that?
For example something like this that we have somewhere in our code:
try:
import transformers
except ImportError:
raise ImportError('Please run `pip install transformers`.')
So, it looks like the build_website still wants the package explicitly in requirements.txt. Should I put it in then or is it ok if that test doesn't pass?
Overall, the package seems pretty small https://pypi.org/project/openai/#files . So, adding it shouldn't be a big burden.
I also plan on adding a GPT4/ChatGPT variant which uses a separate API endpoint soon. So, once I figure out how to iron out CI/CD issues in this PR, I'll make one for the other endpoint in the upcoming weeks. So be on the look out for that! ^.^
Sure, you can include it, but please pin it to a version (e.g., openai<=1.0.1
). And, make sure to update the cache keys in the circle CI config if you do so (please simply change the dates on all keys that look like the linked one to the date you make the change)
Added openai to requirements.txt and changed the date to circleci config.yaml. For the yaml changes, I pattern matched against this PR: https://github.com/facebookresearch/ParlAI/commit/104fb967172ff80cac24e22026341cc84253912a
Could you pin to a <=
version instead of >=
? you can also do ~=
to pin exactly to the version
Hopefully that resolves the last of the lint errors. What linter does the lint ci/cd use? It seems to complain about formatting that the autoformat.sh (black autoformat) is ok with?
Thanks for reviewing this! Do I merge the PR or do y'all (maintainers) merge the PR?
You can merge it yourself. It always feels good to merge ;)
This is my first time contributing to ParlAI. Normally you'd expect a merge button on a the PR once the PR is approved right?
This is what I see at the bottom of this PR. I don't see any merge button which suggests to me that the master branch is protected, so I can't merge it?
Oh, OK. I was not aware of that. Merging this. Thanks!
Patch description
This pull request adds support for GPT-3 models via OpenAI's python completion endpoint. This is a followup on this issue that discussed how to integrate a model. I've followed the steps at the end of the linked issue to help properly implement the model for ParlAI.
Testing steps We have manually tested the changes and confirmed that they work for both
self-chat
andinteractive
commands