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

Better error resilience. #538

Merged
merged 3 commits into from
Aug 10, 2023
Merged

Better error resilience. #538

merged 3 commits into from
Aug 10, 2023

Conversation

squidarth
Copy link
Collaborator

Right now, truss predict behaves weirdly if there are errors. This makes us more resilient to those errors. The change in this PR defends against this case:

$ [~]$ curl -X POST https://app.baseten.co/models/9P2boVP/predict \
  -H 'Authorization: Api-Key g9RlcBM6.JfudVBlNqMjTNbnprEQAWHoZtbUajWrh' \
  -d '{"a": "b", "c": true}'
{
	"error": "Model is not ready, it is still building or deploying"
}

specifically

@@ -47,6 +47,14 @@ def decode_content():

return decode_content()

parsed_response = response.json()

if "model_output" not in parsed_response:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be more clear to check for existence of the error key if we know it will always come with that

@squidarth squidarth merged commit 0d299e3 into main Aug 10, 2023
@squidarth squidarth deleted the sshanker/resilience-to-errors branch August 10, 2023 20:50
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.

3 participants