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

refactor: OpenAI token limits #7326

Merged
merged 11 commits into from
Mar 7, 2024
Merged

refactor: OpenAI token limits #7326

merged 11 commits into from
Mar 7, 2024

Conversation

sjrl
Copy link
Contributor

@sjrl sjrl commented Mar 7, 2024

Related Issues

  • fixes #issue-number

Proposed Changes:

Some refactoring of the code used to properly assign the token limit for the different OpenAI models.

How did you test it?

Consolidated tests and added more tests.

Notes for the reviewer

Checklist

@sjrl sjrl requested review from a team as code owners March 7, 2024 07:25
@sjrl sjrl requested review from dfokina and silvanocerza and removed request for a team March 7, 2024 07:25
@sjrl sjrl changed the base branch from main to v1.x March 7, 2024 07:25
@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 type:documentation Improvements on the docs labels Mar 7, 2024
@sjrl sjrl requested review from anakin87 and removed request for silvanocerza March 7, 2024 07:26
@sjrl sjrl added 1.x and removed 2.x Related to Haystack v2.0 labels Mar 7, 2024
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

I like the simplification!

I left a small comment.

haystack/utils/openai_utils.py Outdated Show resolved Hide resolved
@anakin87
Copy link
Member

anakin87 commented Mar 7, 2024

feel free to merge...

@sjrl sjrl merged commit d6c3ebe into v1.x Mar 7, 2024
49 checks passed
@sjrl sjrl deleted the update-token-limits branch March 7, 2024 09:09
@masci masci added this to the 1.25.1 milestone Mar 22, 2024
vblagoje pushed a commit that referenced this pull request Mar 25, 2024
* Update OpenAI token limits

* UPdate test to be paramatrized

* Add davinici and babbage

* Fix remaining tests

* Remove gpt2 as default tokenizer

* Update doc string

* Add another edge case

* Add more tests

* Indent blocks

* Remove unnecessary developer comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants