mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
update baseten handler to handle TGI calls
This commit is contained in:
parent
a86e771c23
commit
4927e5879f
8 changed files with 79 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
|||
import os, openai, sys, json
|
||||
import os, openai, sys, json, inspect
|
||||
from typing import Any
|
||||
from functools import partial
|
||||
import dotenv, traceback, random, asyncio, time, contextvars
|
||||
|
@ -682,7 +682,7 @@ def completion(
|
|||
litellm_params=litellm_params,
|
||||
logger_fn=logger_fn,
|
||||
)
|
||||
if "stream" in optional_params and optional_params["stream"] == True:
|
||||
if inspect.isgenerator(model_response) or ("stream" in optional_params and optional_params["stream"] == True):
|
||||
# don't try to access stream object,
|
||||
response = CustomStreamWrapper(
|
||||
model_response, model, custom_llm_provider="baseten", logging_obj=logging
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue