You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generate method in Python allows a callback to be provided so you can control the tokens being produced. However, there is no signal that the generation has completed. There should be some signal received, either a separate callback or perhaps a boolean in the callback like is_final_token.
The workarounds is for whatever is streaming the tokens to then signal it's received everything. However, this muddies the layers.
So for example:
Component A receives streaming input and displays it on screen
Component B is responsible for creating and managing the model and is what you call generate on
With the current API, Component B that owns the model itself doesn't know when the model is done. There are no methods on the model to ask is_generating or any param in the callback or another callback to signal it's done. This makes it difficult for Component B to do clean up or perform logic that should happen after generation is completed.
Hope that makes sense.
This should hopefully be really simple to implement but would make user logic much cleaner.
The text was updated successfully, but these errors were encountered:
Feature Request
The generate method in Python allows a callback to be provided so you can control the tokens being produced. However, there is no signal that the generation has completed. There should be some signal received, either a separate callback or perhaps a boolean in the callback like is_final_token.
The workarounds is for whatever is streaming the tokens to then signal it's received everything. However, this muddies the layers.
So for example:
Component A receives streaming input and displays it on screen
Component B is responsible for creating and managing the model and is what you call generate on
With the current API, Component B that owns the model itself doesn't know when the model is done. There are no methods on the model to ask is_generating or any param in the callback or another callback to signal it's done. This makes it difficult for Component B to do clean up or perform logic that should happen after generation is completed.
Hope that makes sense.
This should hopefully be really simple to implement but would make user logic much cleaner.
The text was updated successfully, but these errors were encountered: