From 6e3fcab4272f2fbf59fc5d8456fbba6eb24ab884 Mon Sep 17 00:00:00 2001 From: Matej Aleksandrov Date: Tue, 17 Dec 2024 05:17:37 -0800 Subject: [PATCH] Regenerate stubs with Mypy 1.13.0 PiperOrigin-RevId: 707053489 Change-Id: I19e5943e01d1056c7fd665668c179ac9d65ac083 --- saxml/client/python/sax.pyi | 42 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/saxml/client/python/sax.pyi b/saxml/client/python/sax.pyi index 851bee7..2c65a21 100644 --- a/saxml/client/python/sax.pyi +++ b/saxml/client/python/sax.pyi @@ -1,6 +1,4 @@ -from typing import Any, Callable, List, Optional, Union - -from typing import overload +from typing import Callable, overload class AdminOptions: timeout: float @@ -11,9 +9,9 @@ class AdminOptions: class AudioModel: def __init__(self, *args, **kwargs) -> None: ... @overload - def Recognize(self, id: str, options: ModelOptions = ...) -> list[tuple[str,float]]: ... + def Recognize(self, id: str, options: ModelOptions = ...) -> list[tuple[str, float]]: ... @overload - def Recognize(self, audio_bytes: str, options: ModelOptions = ...) -> list[tuple[str,float]]: ... + def Recognize(self, audio_bytes: str, options: ModelOptions = ...) -> list[tuple[str, float]]: ... class CustomModel: def __init__(self, *args, **kwargs) -> None: ... @@ -25,9 +23,9 @@ class CustomModel: class LanguageModel: def __init__(self, *args, **kwargs) -> None: ... def Embed(self, text: str, options: ModelOptions = ...) -> list[float]: ... - def Generate(self, text: str, options: ModelOptions = ...) -> list[tuple[str,float]]: ... + def Generate(self, text: str, options: ModelOptions = ...) -> list[tuple[str, float]]: ... def GenerateStream(self, text: str, callback: Callable, options: ModelOptions = ...) -> None: ... - def Gradient(self, prefix: str, suffix: str, options: ModelOptions = ...) -> tuple[list[float],dict[str,list[float]]]: ... + def Gradient(self, prefix: str, suffix: str, options: ModelOptions = ...) -> tuple[list[float], dict[str, list[float]]]: ... def Score(self, prefix: str, suffix: list[str], options: ModelOptions = ...) -> list[float]: ... class Model: @@ -52,7 +50,7 @@ class ModelDetail: @property def model(self) -> str: ... @property - def overrides(self) -> dict[str,str]: ... + def overrides(self) -> dict[str, str]: ... class ModelOptions: def __init__(self) -> None: ... @@ -63,7 +61,7 @@ class ModelOptions: def SetExtraInputTensor(self, arg0: str, arg1: list[float]) -> None: ... def SetTimeout(self, arg0: float) -> None: ... def ToDebugString(self) -> str: ... - def ToProto(self, *args, **kwargs) -> Any: ... + def ToProto(self, *args, **kwargs): ... def __copy__(self) -> ModelOptions: ... def __deepcopy__(self, arg0: dict) -> ModelOptions: ... @@ -78,9 +76,9 @@ class ModelServerTypeStat: class MultimodalModel: def __init__(self, *args, **kwargs) -> None: ... - def Embed(self, *args, **kwargs) -> Any: ... - def Generate(self, *args, **kwargs) -> Any: ... - def Score(self, *args, **kwargs) -> Any: ... + def Embed(self, *args, **kwargs): ... + def Generate(self, *args, **kwargs): ... + def Score(self, *args, **kwargs): ... class Options: fail_fast: bool @@ -92,22 +90,22 @@ class Options: class VisionModel: def __init__(self, *args, **kwargs) -> None: ... - def Classify(self, image_bytes: str, options: ModelOptions = ...) -> list[tuple[str,float]]: ... - def Detect(self, image_bytes: str, text: list[str] = ..., boxes: list[tuple[float,float,float,float]] = ..., options: ModelOptions = ...) -> list[tuple[float,float,float,float,bytes,float,tuple[int,int,bytes]]]: ... + def Classify(self, image_bytes: str, options: ModelOptions = ...) -> list[tuple[str, float]]: ... + def Detect(self, image_bytes: str, text: list[str] = ..., boxes: list[tuple[float, float, float, float]] = ..., options: ModelOptions = ...) -> list[tuple[float, float, float, float, bytes, float, tuple[int, int, bytes]]]: ... def Embed(self, image: str, options: ModelOptions = ...) -> list[float]: ... - def ImageToImage(self, text: str, options: ModelOptions = ...) -> list[tuple[bytes,float]]: ... - def ImageToText(self, image_bytes: str, text: str = ..., options: ModelOptions = ...) -> list[tuple[bytes,float]]: ... - def TextAndImageToImage(self, text: str, image_bytes: str, options: ModelOptions = ...) -> list[tuple[bytes,float]]: ... - def TextToImage(self, text: str, options: ModelOptions = ...) -> list[tuple[bytes,float]]: ... + def ImageToImage(self, text: str, options: ModelOptions = ...) -> list[tuple[bytes, float]]: ... + def ImageToText(self, image_bytes: str, text: str = ..., options: ModelOptions = ...) -> list[tuple[bytes, float]]: ... + def TextAndImageToImage(self, text: str, image_bytes: str, options: ModelOptions = ...) -> list[tuple[bytes, float]]: ... + def TextToImage(self, text: str, options: ModelOptions = ...) -> list[tuple[bytes, float]]: ... def TokenToVideo(self, tokens: list[float], options: ModelOptions = ...) -> list[bytes]: ... - def VideoToText(self, image_frames: list[str], text: str = ..., options: ModelOptions = ...) -> list[tuple[bytes,float]]: ... + def VideoToText(self, image_frames: list[str], text: str = ..., options: ModelOptions = ...) -> list[tuple[bytes, float]]: ... def VideoToToken(self, image_frames: list[str], options: ModelOptions = ...) -> list[float]: ... -def GetACL(cell_or_model_id: str, method_id: str = ..., options: AdminOptions = ...) -> Union[str,dict[str,str]]: ... -def List(id: str, options: AdminOptions = ...) -> tuple[str,str,int]: ... +def GetACL(cell_or_model_id: str, method_id: str = ..., options: AdminOptions = ...) -> str | dict[str, str]: ... +def List(id: str, options: AdminOptions = ...) -> tuple[str, str, int]: ... def ListAll(id: str, options: AdminOptions = ...) -> list[str]: ... def ListDetail(id: str, options: AdminOptions = ...) -> ModelDetail: ... -def Publish(id: str, model_path: str, checkpoint_path: str, num_replicas: int, overrides: Optional[dict[str,str]] = ..., options: AdminOptions = ...) -> None: ... +def Publish(id: str, model_path: str, checkpoint_path: str, num_replicas: int, overrides: dict[str, str] | None = ..., options: AdminOptions = ...) -> None: ... def SetACL(cell_or_model_id: str, acl: str, method_id: str = ..., options: AdminOptions = ...) -> None: ... def StartDebugPort(arg0: int) -> None: ... def Stats(id: str, options: AdminOptions = ...) -> list[ModelServerTypeStat]: ...