From 3c570421d3a2eb24528b5f5bb615dcb0c7717e4a Mon Sep 17 00:00:00 2001 From: wfjsw Date: Tue, 18 Jul 2023 19:00:16 +0800 Subject: [PATCH] move start timer --- launch.py | 4 +++- modules/api/models.py | 2 +- modules/launch_utils.py | 3 --- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/launch.py b/launch.py index b103c8f3a..e9667c88e 100644 --- a/launch.py +++ b/launch.py @@ -1,4 +1,4 @@ -from modules import launch_utils +from modules import launch_utils, timer args = launch_utils.args @@ -25,6 +25,8 @@ start = launch_utils.start def main(): + timer.startup_timer.record("start") + if not args.skip_prepare_environment: prepare_environment() diff --git a/modules/api/models.py b/modules/api/models.py index b55fa7288..96cfe920e 100644 --- a/modules/api/models.py +++ b/modules/api/models.py @@ -213,7 +213,7 @@ for key, metadata in opts.data_labels.items(): value = None optType = opts.typemap.get(type(metadata.default), type(value)) - if optType == types.NoneType: + if isinstance(optType, types.NoneType): pass elif metadata is not None: fields.update({key: (Optional[optType], Field(default=metadata.default, description=metadata.label))}) diff --git a/modules/launch_utils.py b/modules/launch_utils.py index 03552bc26..ea995edaf 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -10,9 +10,6 @@ from functools import lru_cache from modules import cmd_args, errors from modules.paths_internal import script_path, extensions_dir -from modules import timer - -timer.startup_timer.record("start") args, _ = cmd_args.parser.parse_known_args()