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

@@ -17,6 +17,7 @@ import os
import re
import sys
from pathlib import Path
from typing import Optional
from unittest.mock import patch
from parameterized import parameterized
@@ -270,13 +271,13 @@ class TestTrainerExt(TestCasePlus):
learning_rate: float = 3e-3,
optim: str = "adafactor",
distributed: bool = False,
extra_args_str: str = None,
extra_args_str: Optional[str] = None,
eval_steps: int = 0,
predict_with_generate: bool = True,
do_train: bool = True,
do_eval: bool = True,
do_predict: bool = True,
n_gpus_to_use: int = None,
n_gpus_to_use: Optional[int] = None,
):
data_dir = self.test_file_dir / "../fixtures/tests_samples/wmt_en_ro"
output_dir = self.get_auto_remove_tmp_dir()