forked from phoenix/litellm-mirror
this commit fixes #883
This commit is contained in:
parent
1af7575c86
commit
0f89c3375a
1 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,8 @@ class VLLMError(Exception):
|
||||||
) # Call the base class constructor with the parameters it needs
|
) # Call the base class constructor with the parameters it needs
|
||||||
|
|
||||||
# check if vllm is installed
|
# check if vllm is installed
|
||||||
def validate_environment(model: str, llm: Any =None):
|
def validate_environment(model: str):
|
||||||
|
global llm
|
||||||
try:
|
try:
|
||||||
from vllm import LLM, SamplingParams # type: ignore
|
from vllm import LLM, SamplingParams # type: ignore
|
||||||
if llm is None:
|
if llm is None:
|
||||||
|
@ -131,9 +132,8 @@ def batch_completions(
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
global llm
|
|
||||||
try:
|
try:
|
||||||
llm, SamplingParams = validate_environment(model=model, llm=llm)
|
llm, SamplingParams = validate_environment(model=model)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error_str = str(e)
|
error_str = str(e)
|
||||||
if "data parallel group is already initialized" in error_str:
|
if "data parallel group is already initialized" in error_str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue