Skip to content
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

[PY] fix: Map tokens config to max_tokens when non-o1 model is used. #2151

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

singhk97
Copy link
Collaborator

@singhk97 singhk97 commented Oct 29, 2024

Linked issues

closes: #minor

Details

Using the max_completion_tokens field is not supported for non-o1 models in Azure OpenAI.

Change details

  • In openai_model.py if the model is not in the o1 series, then use max_tokens field by default.

Attestation Checklist

  • My code follows the style guidelines of this project

  • I have checked for/fixed spelling, linting, and other errors

  • I have commented my code for clarity

  • I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)

  • My changes generate no new warnings

  • I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:

    • Local testing
    • E2E testing in Teams
  • New and existing unit tests pass locally with my changes

@singhk97 singhk97 requested review from a team, aacebo, corinagum and lilyydu as code owners October 29, 2024 17:35
Copy link
Collaborator

@corinagum corinagum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit tests?

lilyydu
lilyydu previously approved these changes Oct 30, 2024
corinagum
corinagum previously approved these changes Oct 30, 2024
Copy link
Collaborator

@lilyydu lilyydu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding tests, just 1 nit

@singhk97 singhk97 merged commit afdd0aa into main Oct 31, 2024
20 checks passed
@singhk97 singhk97 deleted the kavin/o1-fix branch October 31, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants