-
Notifications
You must be signed in to change notification settings - Fork 833
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: Fixing OpenAIPrompt class to be able to work with older models like text-davinci-003 #2319
base: master
Are you sure you want to change the base?
Conversation
1. Ensuring that new prompt instances are created for each test. This will eliminate chance of one test interfering with another test. 2. Creating test to validate that for older model deployments, OpenAiCompletion instance is created in OpenAIPrompt class. 3. Fixing the bug that caused creation of OpenAICompletion object to fail. 4. Cleaning some code in OpenAIPrompt class.
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2319 +/- ##
===========================================
- Coverage 83.21% 12.94% -70.27%
===========================================
Files 328 328
Lines 16786 16786
Branches 1501 1511 +10
===========================================
- Hits 13968 2173 -11795
- Misses 2818 14613 +11795 ☔ View full report in Codecov by Sentry. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPromptSuite.scala
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAI.scala
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
/azp run |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
/azp run |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Issue
While working with
OpenAIPrompt
class, I discovered that this class does not work with older models. Upon investigation, I found that for models specified in the listlegacyModels
, OpenAIPrompt class suppose to useOpenAICompletion
instance, for all other model deployment names,OpenAIChatCompletion
class is to be used. When setting parameter forOpenAICompletion
, it tries to set parameters that are not available inOpenAICompletion
, which causes instance creation to fail. There are no current unit tests or integration tests that verified this. In this PR, I am fixing this problem and adding unit test to validate this. I am also cleaning unit test and OpenAIPrompt class.What changes are proposed in this pull request?
In this PR I am:
How is this patch tested?
Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?