From 0f89c3375ab71e4914a65fd021e9d21da6da1d57 Mon Sep 17 00:00:00 2001 From: maqsoodshaik Date: Thu, 23 Nov 2023 12:45:38 +0100 Subject: [PATCH] this commit fixes #883 --- litellm/llms/vllm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/llms/vllm.py b/litellm/llms/vllm.py index 9f4d480f6..428dc959d 100644 --- a/litellm/llms/vllm.py +++ b/litellm/llms/vllm.py @@ -18,7 +18,8 @@ class VLLMError(Exception): ) # Call the base class constructor with the parameters it needs # check if vllm is installed -def validate_environment(model: str, llm: Any =None): +def validate_environment(model: str): + global llm try: from vllm import LLM, SamplingParams # type: ignore if llm is None: @@ -131,9 +132,8 @@ def batch_completions( ] ) """ - global llm try: - llm, SamplingParams = validate_environment(model=model, llm=llm) + llm, SamplingParams = validate_environment(model=model) except Exception as e: error_str = str(e) if "data parallel group is already initialized" in error_str: