Update Optional[x] -> x | None and Union[x, y] to x | y (#26633)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import datetime
|
||||
import os
|
||||
import tempfile
|
||||
import urllib.request
|
||||
from collections.abc import Sequence
|
||||
from typing import Any, Union
|
||||
from typing import Any
|
||||
|
||||
import albumentations
|
||||
import numpy as np
|
||||
@@ -160,11 +158,11 @@ def read_geotiff(
|
||||
|
||||
|
||||
def load_image(
|
||||
data: Union[list[str]],
|
||||
data: list[str],
|
||||
path_type: str,
|
||||
mean: list[float] | None = None,
|
||||
std: list[float] | None = None,
|
||||
indices: Union[list[int], None] | None = None,
|
||||
indices: list[int] | None | None = None,
|
||||
):
|
||||
"""Build an input example by loading images in *file_paths*.
|
||||
|
||||
@@ -280,7 +278,7 @@ class PrithviMultimodalDataProcessor(IOProcessor):
|
||||
prompt: IOProcessorInput,
|
||||
request_id: str | None = None,
|
||||
**kwargs,
|
||||
) -> Union[PromptType, Sequence[PromptType]]:
|
||||
) -> PromptType | Sequence[PromptType]:
|
||||
image_data = dict(prompt)
|
||||
|
||||
if request_id:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from typing import Any, Literal, Optional, TypedDict, Union
|
||||
from typing import Any, Literal, TypedDict
|
||||
|
||||
import albumentations
|
||||
from pydantic import BaseModel
|
||||
@@ -38,7 +38,7 @@ class ImagePrompt(BaseModel):
|
||||
"""
|
||||
|
||||
|
||||
MultiModalPromptType = Union[ImagePrompt]
|
||||
MultiModalPromptType = ImagePrompt
|
||||
|
||||
|
||||
class ImageRequestOutput(BaseModel):
|
||||
@@ -54,4 +54,4 @@ class ImageRequestOutput(BaseModel):
|
||||
type: Literal["path", "b64_json"]
|
||||
format: str
|
||||
data: str
|
||||
request_id: Optional[str] = None
|
||||
request_id: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user