Skip to content

Commit 79090f4

Browse files
Update copyright and import statements in config.py
support custom mode
1 parent 0950c5e commit 79090f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ppsci/utils/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from typing import Mapping
1919
from typing import Optional
2020
from typing import Tuple
21+
from typing import Union
2122

2223
from typing_extensions import Literal
2324

@@ -301,7 +302,7 @@ class SolverConfig(BaseModel):
301302
"""
302303

303304
# Global settings config
304-
mode: Literal["train", "eval", "export", "infer"] = "train"
305+
mode: Union[Literal["train", "eval", "export", "infer"], str] = "train"
305306
output_dir: Optional[str] = None
306307
log_freq: int = 20
307308
seed: int = 42
@@ -461,3 +462,4 @@ def use_wandb_check(cls, v, info: ValidationInfo):
461462
logger.error(
462463
"paddlesci requires pydantic>=2.5.0; otherwise, built-in examples may not run properly."
463464
)
465+

0 commit comments

Comments
 (0)