Add Optional to remaining types (#37808)
More Optional typing Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import time
|
||||
from json import JSONDecodeError
|
||||
from logging import getLogger
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
from torch.utils.data import DataLoader
|
||||
@@ -54,7 +55,7 @@ def eval_data_dir(
|
||||
task="summarization",
|
||||
local_rank=None,
|
||||
num_return_sequences=1,
|
||||
dataset_kwargs: dict = None,
|
||||
dataset_kwargs: Optional[dict] = None,
|
||||
prefix="",
|
||||
**generate_kwargs,
|
||||
) -> dict:
|
||||
|
||||
@@ -74,7 +74,7 @@ class ImgprocModelImageProcessor(BaseImageProcessor):
|
||||
def __init__(
|
||||
self,
|
||||
do_resize: bool = True,
|
||||
size: dict[str, int] = None,
|
||||
size: Optional[dict[str, int]] = None,
|
||||
resample: PILImageResampling = PILImageResampling.BICUBIC,
|
||||
do_rescale: bool = True,
|
||||
rescale_factor: Union[int, float] = 1 / 255,
|
||||
@@ -159,7 +159,7 @@ class ImgprocModelImageProcessor(BaseImageProcessor):
|
||||
image_mean: Optional[Union[float, list[float]]] = None,
|
||||
image_std: Optional[Union[float, list[float]]] = None,
|
||||
return_tensors: Optional[Union[str, TensorType]] = None,
|
||||
do_convert_rgb: bool = None,
|
||||
do_convert_rgb: Optional[bool] = None,
|
||||
data_format: ChannelDimension = ChannelDimension.FIRST,
|
||||
input_data_format: Optional[Union[str, ChannelDimension]] = None,
|
||||
) -> PIL.Image.Image:
|
||||
|
||||
Reference in New Issue
Block a user