mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
add oobabooga text web api support
This commit is contained in:
parent
31fc90b239
commit
ecad921b01
8 changed files with 160 additions and 1 deletions
|
@ -35,6 +35,7 @@ from .llms import vllm
|
|||
from .llms import ollama
|
||||
from .llms import cohere
|
||||
from .llms import petals
|
||||
from .llms import oobabooga
|
||||
import tiktoken
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from typing import Callable, List, Optional, Dict
|
||||
|
@ -686,6 +687,28 @@ def completion(
|
|||
)
|
||||
return response
|
||||
response = model_response
|
||||
elif custom_llm_provider == "oobabooga":
|
||||
custom_llm_provider = "oobabooga"
|
||||
model_response = oobabooga.completion(
|
||||
model=model,
|
||||
messages=messages,
|
||||
model_response=model_response,
|
||||
api_base=api_base, # type: ignore
|
||||
print_verbose=print_verbose,
|
||||
optional_params=optional_params,
|
||||
litellm_params=litellm_params,
|
||||
api_key=None,
|
||||
logger_fn=logger_fn,
|
||||
encoding=encoding,
|
||||
logging_obj=logging
|
||||
)
|
||||
if "stream" in optional_params and optional_params["stream"] == True:
|
||||
# don't try to access stream object,
|
||||
response = CustomStreamWrapper(
|
||||
model_response, model, custom_llm_provider="oobabooga", logging_obj=logging
|
||||
)
|
||||
return response
|
||||
response = model_response
|
||||
elif custom_llm_provider == "together_ai" or ("togethercomputer" in model) or (model in litellm.together_ai_models):
|
||||
custom_llm_provider = "together_ai"
|
||||
together_ai_key = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue