Add Optional to remaining types (#37808)
More Optional typing Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from typing import Dict
|
||||
from typing import Dict, Optional
|
||||
|
||||
from ...configuration_utils import PretrainedConfig
|
||||
from ...modeling_rope_utils import rope_config_validation
|
||||
@@ -268,7 +268,7 @@ class AriaConfig(PretrainedConfig):
|
||||
vision_config=None,
|
||||
vision_feature_layer: int = -1,
|
||||
text_config: AriaTextConfig = None,
|
||||
projector_patch_to_query_dict: Dict = None,
|
||||
projector_patch_to_query_dict: Optional[Dict] = None,
|
||||
image_token_index: int = 9,
|
||||
initializer_range: float = 0.02,
|
||||
**kwargs,
|
||||
|
||||
@@ -124,8 +124,8 @@ class AriaImageProcessor(BaseImageProcessor):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
image_mean: List[float] = None,
|
||||
image_std: List[float] = None,
|
||||
image_mean: Optional[List[float]] = None,
|
||||
image_std: Optional[List[float]] = None,
|
||||
max_image_size: int = 980,
|
||||
min_image_size: int = 336,
|
||||
split_resolutions: Optional[List[Tuple[int, int]]] = None,
|
||||
|
||||
@@ -276,7 +276,7 @@ class AriaConfig(PretrainedConfig):
|
||||
vision_config=None,
|
||||
vision_feature_layer: int = -1,
|
||||
text_config: AriaTextConfig = None,
|
||||
projector_patch_to_query_dict: Dict = None,
|
||||
projector_patch_to_query_dict: Optional[Dict] = None,
|
||||
image_token_index: int = 9,
|
||||
initializer_range: float = 0.02,
|
||||
**kwargs,
|
||||
@@ -514,8 +514,8 @@ class AriaImageProcessor(BaseImageProcessor):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
image_mean: List[float] = None,
|
||||
image_std: List[float] = None,
|
||||
image_mean: Optional[List[float]] = None,
|
||||
image_std: Optional[List[float]] = None,
|
||||
max_image_size: int = 980,
|
||||
min_image_size: int = 336,
|
||||
split_resolutions: Optional[List[Tuple[int, int]]] = None,
|
||||
|
||||
Reference in New Issue
Block a user