mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-03-20 21:06:52 +08:00
Merge 6175335d2361eecd801c223c070e007babd32d68 into 254f6b986720c92ddf97fbb1a6a6465da8e87e29
This commit is contained in:
commit
a083e410e1
@ -108,7 +108,7 @@ class PoolerConfig:
|
||||
return hash_str
|
||||
|
||||
|
||||
def get_use_activation(o: object):
|
||||
def get_use_activation(o: object) -> bool | None:
|
||||
if softmax := getattr(o, "softmax", None) is not None:
|
||||
logger.warning_once(
|
||||
"softmax will be deprecated and will be removed in v0.15. "
|
||||
|
||||
@ -38,7 +38,7 @@ def rgba_to_rgb(
|
||||
return converted
|
||||
|
||||
|
||||
def convert_image_mode(image: Image.Image, to_mode: str):
|
||||
def convert_image_mode(image: Image.Image, to_mode: str) -> Image.Image:
|
||||
if image.mode == to_mode:
|
||||
return image
|
||||
elif image.mode == "RGBA" and to_mode == "RGB":
|
||||
|
||||
@ -11,7 +11,7 @@ from torch._C._profiler import _EventType, _ProfilerEvent, _TensorMetadata
|
||||
#
|
||||
|
||||
|
||||
def trim_string_front(string, width):
|
||||
def trim_string_front(string: str, width: int) -> str:
|
||||
if len(string) > width:
|
||||
offset = len(string) - width + 3
|
||||
string = string[offset:]
|
||||
@ -20,7 +20,7 @@ def trim_string_front(string, width):
|
||||
return string
|
||||
|
||||
|
||||
def trim_string_back(string, width):
|
||||
def trim_string_back(string: str, width: int) -> str:
|
||||
if len(string) > width:
|
||||
offset = len(string) - width + 3
|
||||
string = string[:-offset]
|
||||
|
||||
@ -12,7 +12,7 @@ except Exception as e:
|
||||
__version_tuple__ = (0, 0, __version__)
|
||||
|
||||
|
||||
def _prev_minor_version_was(version_str):
|
||||
def _prev_minor_version_was(version_str: str) -> bool:
|
||||
"""Check whether a given version matches the previous minor version.
|
||||
|
||||
Return True if version_str matches the previous minor version.
|
||||
@ -32,7 +32,7 @@ def _prev_minor_version_was(version_str):
|
||||
return version_str == f"{__version_tuple__[0]}.{__version_tuple__[1] - 1}"
|
||||
|
||||
|
||||
def _prev_minor_version():
|
||||
def _prev_minor_version() -> str:
|
||||
"""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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user