diff --git a/pyproject.toml b/pyproject.toml index 99185940d..402912c2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "truss" -version = "0.5.7rc2" +version = "0.5.7rc3" description = "A seamless bridge from model development to model delivery" license = "MIT" readme = "README.md" diff --git a/truss/remote/baseten/service.py b/truss/remote/baseten/service.py index 008b1d513..d3ecb26ec 100644 --- a/truss/remote/baseten/service.py +++ b/truss/remote/baseten/service.py @@ -47,6 +47,13 @@ def decode_content(): return decode_content() + parsed_response = response.json() + + if "error" in parsed_response: + # In the case that the model is in a non-ready state, the response + # will be a json with an `error` key. + return parsed_response + return response.json()["model_output"] def authenticate(self) -> dict: