-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] Fix Regex for identifying OpenAI models #778
Conversation
…consider cases pathlib.parts doesn't contain deployment
Hi @alexander-brady and @riedgar-ms, we may want to just move away from the regex-based scheme altogether. To my knowledge, only the gpt-3.5-turbo-instruct line of models uses the legacy Completion interface anymore, so we can perhaps just assume that the model is a EDIT: Upon a bit of investigation, it looks like it is specifically these three model families that leverage the legacy completion endpoints: https://platform.openai.com/docs/models/model-endpoint-compatibility
And of these, I don't believe |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #778 +/- ##
==========================================
+ Coverage 55.34% 62.54% +7.20%
==========================================
Files 55 55
Lines 4082 4074 -8
==========================================
+ Hits 2259 2548 +289
+ Misses 1823 1526 -297 ☔ View full report in Codecov by Sentry. |
I shall take this opportunity to bring up a point I've mentioned before: do we really want to try autodetecting model types like this at all? We are creating something inherently fragile, just to extract a single bit of information (chat vs completion). In the code, this has also led to a rather interesting coding pattern involving mutually recursive constructors, and objects which change their types dynamically. As things stand, we are making life very marginally easier for newcomers. However, when it breaks (and given that we do not control the names of the OpenAI models, breakage is inevitable) I fear that those same newcomers will be in a worse position. |
As a newcomer, not detecting my model as a chat model made me reconsider even using this framework, and I almost gave up on it altogether before deciding to take a closer look at the source code. However, since the majority of OpenAI models use the |
My thoughts are more tending towards renoving the |
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.
Despite my thoughts about whether this is really something we want to be doing, this should fix our immediate issues. @Harsha-Nori ?
Addresses the issue with the model naming convention used by Azure's OpenAI API. It updates the regex pattern to accommodate Azure's distinct format for their 3.5 models, which differs from the OpenAI API's convention. The specific change involves recognizing
gpt-35-turbo
as opposed togpt-3.5-turbo
.Additionally, the deployment path check has been changed to handle scenarios where
pathlib.parts
does not include the deployment path, ensuring more robust path validation during Azure deployments.Closes #761