From dc2c4af631b9d7f43caa9a9224cd9b2a4b539756 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 25 Mar 2024 16:47:17 -0700 Subject: [PATCH] fix(utils.py): fix text completion streaming --- litellm/tests/test_text_completion.py | 3 ++- litellm/utils.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/tests/test_text_completion.py b/litellm/tests/test_text_completion.py index a16b864494b..1a7d2de6e9e 100644 --- a/litellm/tests/test_text_completion.py +++ b/litellm/tests/test_text_completion.py @@ -2907,6 +2907,7 @@ def test_async_text_completion_stream(): async def test_get_response(): try: + litellm.set_verbose = True response = await litellm.atext_completion( model="gpt-3.5-turbo-instruct", prompt="good morning", @@ -2930,7 +2931,7 @@ def test_async_text_completion_stream(): asyncio.run(test_get_response()) -test_async_text_completion_stream() +# test_async_text_completion_stream() @pytest.mark.asyncio diff --git a/litellm/utils.py b/litellm/utils.py index 6543a47691b..bd47e08ba32 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -8899,7 +8899,6 @@ class CustomStreamWrapper: if data_json["choices"][0].get("finish_reason", None): is_finished = True finish_reason = data_json["choices"][0]["finish_reason"] - self.sent_last_chunk = True print_verbose( f"text: {text}; is_finished: {is_finished}; finish_reason: {finish_reason}" )