fix: upgrade deprecated openai api and model davinci to gpt-3.5-turbo#20
Open
lucumango wants to merge 1 commit into
Open
fix: upgrade deprecated openai api and model davinci to gpt-3.5-turbo#20lucumango wants to merge 1 commit into
lucumango wants to merge 1 commit into
Conversation
Author
|
More on deprecations: https://developers.openai.com/api/docs/deprecations/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Updated the
Synthesize.ipynbresearch notebook to use the modernopenai>=1.0.0Python client and migrating the text generation away from deprecated models.The
davincimodel and theopenai==0.28library are currently deprecated and throw anInvalidRequestError/deprecation warning when researchers attempt to run the data synthesis notebook.Summary:
!pip install openai==0.28to!pip install "openai>=1.0.0" pandas.openai.api_key. The script now securely initializes the client using theOPENAI_API_KEYfrom the system's environment variables (os.environ.get).openai.Completion.createutilizing thedavinciengine with the modernclient.chat.completions.createsyntax usinggpt-3.5-turbo.try/exceptblock to gracefully handle potential API rate limits or quota errors without crashing the entire batch loop.openaiv1.x client specifications.Fixes #21