From 29f1d47e73de3764c944a0af0ff10bbc8ce244f4 Mon Sep 17 00:00:00 2001 From: Lu Fang <30275821+houseroad@users.noreply.github.com> Date: Sun, 9 Feb 2025 02:56:40 -0800 Subject: [PATCH] [MISC] Always import version library first in the vllm package (#12979) Signed-off-by: Lu Fang --- vllm/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vllm/__init__.py b/vllm/__init__.py index 566c5116..45778082 100644 --- a/vllm/__init__.py +++ b/vllm/__init__.py @@ -1,5 +1,9 @@ # SPDX-License-Identifier: Apache-2.0 """vLLM: a high-throughput and memory-efficient inference engine for LLMs""" +# The version.py should be independent library, and we always import the +# version library first. Such assumption is critical for some customization. +from .version import __version__, __version_tuple__ # isort:skip + import os import torch @@ -19,8 +23,6 @@ from vllm.outputs import (ClassificationOutput, ClassificationRequestOutput, from vllm.pooling_params import PoolingParams from vllm.sampling_params import SamplingParams -from .version import __version__, __version_tuple__ - # set some common config/environment variables that should be set # for all processes created by vllm and all processes # that interact with vllm workers.