From 4a5175ff637091a173bac79fd297b9cda0c6f07e Mon Sep 17 00:00:00 2001 From: Kanchi Shah Date: Fri, 12 Jul 2024 09:44:53 -0700 Subject: [PATCH 1/2] support handling streaming in SGP --- launch/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/launch/__init__.py b/launch/__init__.py index 6fd2070f..4bbcff12 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", From 42fa8591a71812909e61d91b2a781218a507a925 Mon Sep 17 00:00:00 2001 From: Kanchi Shah Date: Mon, 15 Jul 2024 15:09:30 -0700 Subject: [PATCH 2/2] fix bug --- launch/model_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launch/model_endpoint.py b/launch/model_endpoint.py index 2a45a575..0bd0e279 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"],