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

Handle selector exception #73

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Handle selector exception #73

merged 2 commits into from
Jul 12, 2024

Conversation

tengomucho
Copy link
Collaborator

What does this PR do?

This handles very unlikely to happen exceptions and return empty prefill responses instead of crashing.

If there is an invalid generation config, the selector raises an error.
This is caught by the prefill method, that skips the slot generation,
so the error is handled by the router.
I had not been able to reproduce the problem with a simple HTTP request
to TGI, but it seems it's possible to do it with the HTML form
interface, so it's better to handle this, even if it's unlikely to
happen.
Returning an empty batch is better than crashing.
@tengomucho tengomucho requested a review from mfuntowicz July 11, 2024 15:38
@tengomucho tengomucho merged commit 50ed7bd into main Jul 12, 2024
1 of 2 checks passed
@tengomucho tengomucho deleted the handle-selector-exception branch July 12, 2024 07:27
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