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

Add the "n" parameter to the OAI API #113

Merged
merged 5 commits into from
May 28, 2024
Merged

Add the "n" parameter to the OAI API #113

merged 5 commits into from
May 28, 2024

Conversation

bdashore3
Copy link
Member

Is your pull request related to a problem? Please describe.
See #110

Adds the "n" parameter to the OAI api which allows for multiple choices to be returned at once. This is streamed in asynchronous chunks when streaming is enabled and waited in non-streaming.

@bdashore3 bdashore3 force-pushed the oai-n branch 2 times, most recently from 7d0e208 to 9ad0ec1 Compare May 28, 2024 04:37
bdashore3 added 5 commits May 28, 2024 00:45
v2.5.9.post1

Signed-off-by: kingbri <[email protected]>
This adds the ability to add multiple choices to a generation. This
is only available for non-streaming gens for now, it requires some
more work to port over to streaming.

Signed-off-by: kingbri <[email protected]>
For multiple generations in the same request, nested arrays kept their
original reference, resulting in duplications. This will occur with
any collection type.

For optimization purposes, a deepcopy isn't run for the first iteration
since original references are created.

This is not the most elegant solution, but it works for the described
cases.

Signed-off-by: kingbri <[email protected]>
Use a queue-based system to get choices independently and send them
in the overall streaming payload. This method allows for unordered
streaming of generations.

The system is a bit redundant, so maybe make the code more optimized
in the future.

Signed-off-by: kingbri <[email protected]>
n must be greater than 1 to generate.

Signed-off-by: kingbri <[email protected]>
@bdashore3 bdashore3 merged commit e95e67a into main May 28, 2024
1 check passed
@bdashore3 bdashore3 deleted the oai-n branch September 15, 2024 02:20
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.

1 participant