Skip to content

Commit

Permalink
fix(huggingface_restapi.py): return streamed response correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Feb 16, 2024
1 parent 86886de commit 5f9e141
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions litellm/llms/huggingface_restapi.py
Expand Up @@ -631,11 +631,8 @@ async def async_streaming(
logging_obj=logging_obj,
)

async def generator():
async for transformed_chunk in streamwrapper:
yield transformed_chunk

return generator()
async for transformed_chunk in streamwrapper:
yield transformed_chunk

def embedding(
self,
Expand Down
2 changes: 1 addition & 1 deletion litellm/tests/test_streaming.py
Expand Up @@ -899,7 +899,7 @@ async def test_sagemaker_streaming_async():
pytest.fail(f"An exception occurred - {str(e)}")


asyncio.run(test_sagemaker_streaming_async())
# asyncio.run(test_sagemaker_streaming_async())


def test_completion_sagemaker_stream():
Expand Down

0 comments on commit 5f9e141

Please sign in to comment.