跳至内容

vllm.version

_prev_minor_version

_prev_minor_version()

出于测试目的,返回一个之前的次要版本号。

Source code in vllm/version.py
def _prev_minor_version():
    """For the purpose of testing, return a previous minor version number."""
    # In dev tree, this will return "0.-1", but that will work fine"
    assert isinstance(__version_tuple__[1], int)
    return f"{__version_tuple__[0]}.{__version_tuple__[1] - 1}"

_prev_minor_version_was

_prev_minor_version_was(version_str)

检查给定版本是否与上一个次要版本匹配。

如果version_str匹配上一个次要版本,则返回True。

例如 - 如果当前版本是0.7.4而提供的version_str是'0.6',则返回True。

用于 --show-hidden-metrics-for-version。

Source code in vllm/version.py
def _prev_minor_version_was(version_str):
    """Check whether a given version matches the previous minor version.

    Return True if version_str matches the previous minor version.

    For example - return True if the current version if 0.7.4 and the
    supplied version_str is '0.6'.

    Used for --show-hidden-metrics-for-version.
    """
    # Match anything if this is a dev tree
    if __version_tuple__[0:2] == (0, 0):
        return True

    # Note - this won't do the right thing when we release 1.0!
    assert __version_tuple__[0] == 0
    assert isinstance(__version_tuple__[1], int)
    return version_str == f"{__version_tuple__[0]}.{__version_tuple__[1] - 1}"