Convert formatting to use ruff instead of yapf + isort (#26247)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-05 07:06:22 -07:00
committed by GitHub
parent 17edd8a807
commit d6953beb91
1508 changed files with 115205 additions and 94107 deletions
+19 -10
View File
@@ -12,12 +12,21 @@ from .base import get_vllm_public_assets
VLM_IMAGES_DIR = "vision_model_images"
ImageAssetName = Literal["stop_sign", "cherry_blossom", "hato",
"2560px-Gfp-wisconsin-madison-the-nature-boardwalk",
"Grayscale_8bits_palette_sample_image",
"1280px-Venn_diagram_rgb", "RGBA_comp", "237-400x300",
"231-200x300", "27-500x500", "17-150x600",
"handelsblatt-preview", "paper-11"]
ImageAssetName = Literal[
"stop_sign",
"cherry_blossom",
"hato",
"2560px-Gfp-wisconsin-madison-the-nature-boardwalk",
"Grayscale_8bits_palette_sample_image",
"1280px-Venn_diagram_rgb",
"RGBA_comp",
"237-400x300",
"231-200x300",
"27-500x500",
"17-150x600",
"handelsblatt-preview",
"paper-11",
]
@dataclass(frozen=True)
@@ -28,12 +37,12 @@ class ImageAsset:
"""
Return s3 path for given image.
"""
return get_vllm_public_assets(filename=f"{self.name}.{ext}",
s3_prefix=VLM_IMAGES_DIR)
return get_vllm_public_assets(
filename=f"{self.name}.{ext}", s3_prefix=VLM_IMAGES_DIR
)
@property
def pil_image(self, ext="jpg") -> Image.Image:
image_path = self.get_path(ext)
return Image.open(image_path)
@@ -42,7 +51,7 @@ class ImageAsset:
"""
Image embeddings, only used for testing purposes with llava 1.5.
"""
image_path = self.get_path('pt')
image_path = self.get_path("pt")
return torch.load(image_path, map_location="cpu", weights_only=True)
def read_bytes(self, ext: str) -> bytes: