From e1839c8da23186c43b2c48ab0849648a6f3d2c99 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 15 Aug 2024 19:45:59 -0700 Subject: [PATCH] allow index to not exist in sagemaker chunks --- litellm/llms/sagemaker.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/litellm/llms/sagemaker.py b/litellm/llms/sagemaker.py index a839c03b79..32146b9cae 100644 --- a/litellm/llms/sagemaker.py +++ b/litellm/llms/sagemaker.py @@ -808,16 +808,11 @@ class AWSEventStreamDecoder: self.model = model self.parser = EventStreamJSONParser() self.content_blocks: List = [] - self.index = 0 def _chunk_parser(self, chunk_data: dict) -> GChunk: verbose_logger.debug("in sagemaker chunk parser, chunk_data %s", chunk_data) _token = chunk_data.get("token", {}) or {} - _index = chunk_data.get("index", None) - if _index is None: - _index = self.index - self.index += 1 - + _index = chunk_data.get("index", None) or 0 is_finished = False finish_reason = ""