Add Optional to remaining types (#37808)

More Optional typing

Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
Yuanyuan Chen
2025-04-28 21:20:45 +08:00
committed by GitHub
parent 1a9188a54e
commit da4ff2a5f5
206 changed files with 553 additions and 531 deletions

View File

@@ -19,6 +19,7 @@ import os
import unittest
from copy import deepcopy
from functools import partial
from typing import Optional
import datasets
from parameterized import parameterized
@@ -1252,8 +1253,8 @@ class TestDeepSpeedWithLauncher(TestCasePlus):
do_eval: bool = True,
quality_checks: bool = True,
fp32: bool = False,
extra_args_str: str = None,
remove_args_str: str = None,
extra_args_str: Optional[str] = None,
remove_args_str: Optional[str] = None,
):
# we are doing quality testing so using a small real model
output_dir = self.run_trainer(
@@ -1285,8 +1286,8 @@ class TestDeepSpeedWithLauncher(TestCasePlus):
do_eval: bool = True,
distributed: bool = True,
fp32: bool = False,
extra_args_str: str = None,
remove_args_str: str = None,
extra_args_str: Optional[str] = None,
remove_args_str: Optional[str] = None,
):
max_len = 32
data_dir = self.test_file_dir / "../fixtures/tests_samples/wmt_en_ro"