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

support speculative execution for openai API #48

Merged
merged 12 commits into from
Jan 25, 2024
Merged

Conversation

parasol-aser
Copy link
Collaborator

No description provided.

@parasol-aser
Copy link
Collaborator Author

parasol-aser commented Jan 18, 2024

this PR supports online speculative execution. the basic idea is to track what's returned in previous gen calls and match with the prefix text

  • if there is a match, reuse the completion and correct the name mapping

  • in the test openai_example_speculative.py, now OPENAI API is called only once, instead of three times

Construct a character. Here is an example:
Name: Steve Jobs. Birthday: February 24, 1955. Job: Apple CEO.
Please generate new Name, Birthday and Job.
Name:  Maya Rodriguez
Birthday: October 12, 1989
Job: Graphic

@merrymercy merrymercy changed the title support speculative execution support speculative execution for openai API Jan 19, 2024
@merrymercy merrymercy merged commit 2395005 into main Jan 25, 2024
@merrymercy merrymercy deleted the speculative-execution branch January 25, 2024 09:57
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.

None yet

3 participants