-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
Description
The current frontend using OpenAI will invoke multiple calls for the example below:
@sgl.function
def example(s):
s += "Construct a character."
s += "Name: " + gen("name") + " Birthday: " + gen("birthday") + " Job: " + gen("job")
We can optimize this to send less number of calls to save money:
- Gen longer in the first gen call, and skip the later if the first gen did the right thing.
- Allow using OpenAI's n=10 keyword argument to sample multiple completions when forked. We can also provide the interface
example.run(n=10).