-
Notifications
You must be signed in to change notification settings - Fork 831
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 84.50% 84.49% -0.01%
==========================================
Files 326 328 +2
Lines 16755 16771 +16
Branches 1480 1513 +33
==========================================
+ Hits 14158 14170 +12
- Misses 2597 2601 +4 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
} | ||
|
||
|
||
test("Validating OpenAICompletion and OpenAIChatCompletion for correctModels") { |
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.
gorgeous!
@@ -307,4 +308,6 @@ abstract class OpenAIServicesBase(override val uid: String) extends CognitiveSer | |||
} | |||
super.getInternalTransformer(schema) | |||
} | |||
|
|||
private[openai] def prepareEntityAIService: Row => Option[AbstractHttpEntity] = this.prepareEntity |
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.
is this function necessary? seems like its not but hard to tell
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?