diff --git a/launch/__init__.py b/launch/__init__.py index 6fd2070..4bbcff1 100644 --- a/launch/__init__.py +++ b/launch/__init__.py @@ -28,6 +28,7 @@ EndpointRequest, EndpointResponse, EndpointResponseFuture, + EndpointResponseStream, SyncEndpoint, ) @@ -39,6 +40,7 @@ "EndpointRequest", "EndpointResponse", "EndpointResponseFuture", + "EndpointResponseStream", "LaunchClient", "ModelBundle", "PostInferenceHooks", diff --git a/launch/model_endpoint.py b/launch/model_endpoint.py index 2a45a57..0bd0e27 100644 --- a/launch/model_endpoint.py +++ b/launch/model_endpoint.py @@ -305,7 +305,7 @@ def __next__(self): """Uses server-sent events to iterate through the stream.""" event = self.events.__next__() data = json.loads(event.data) - result = data.get("result", {}) + result = data.get("result", {}) or {} return EndpointResponse( client=None, status=data["status"],