diff options
| author | Djshinshin <129614060+Djshinshin@users.noreply.github.com> | 2026-08-14 14:39:19 +0800 |
|---|---|---|
| committer | Djshinshin <129614060+Djshinshin@users.noreply.github.com> | 2026-08-14 14:42:30 +0800 |
| commit | 5a20e1d1bda93b3f7f898957a10ffdbfe1cbf4f7 (patch) | |
| tree | 9cbb8a4057c4abad005a38c8fb6b48b72606727a /look2hear/utils/parser_utils.py | |
| parent | be0a056079414683d1e1b89d136415882c82acb8 (diff) | |
| download | apollo-gfx803-5a20e1d1bda93b3f7f898957a10ffdbfe1cbf4f7.tar.gz | |
Use Traditional Chinese wording
Diffstat (limited to 'look2hear/utils/parser_utils.py')
| -rw-r--r-- | look2hear/utils/parser_utils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/look2hear/utils/parser_utils.py b/look2hear/utils/parser_utils.py index aa99670..e59ff09 100644 --- a/look2hear/utils/parser_utils.py +++ b/look2hear/utils/parser_utils.py @@ -162,7 +162,7 @@ def instantiate(config, **kwargs): module_path, class_name = config['__target__'].rsplit('.', 1) module = importlib.import_module(module_path) cls = getattr(module, class_name) - # 先处理嵌套的配置 + # 先處理巢狀設定 params = {} for key, value in config.items(): if key != '__target__': @@ -170,9 +170,9 @@ def instantiate(config, **kwargs): params[key] = instantiate(value) else: params[key] = value - # 添加额外的关键字参数 + # 新增額外的關鍵字參數 params.update(kwargs) return cls(**params) else: - # 对于不包含 '__target__' 的字典,递归处理其每个值 - return {k: instantiate(v, **kwargs) if isinstance(v, DictConfig) else v for k, v in config.items()}
\ No newline at end of file + # 對於不包含 '__target__' 的字典,遞迴處理其中每個值 + return {k: instantiate(v, **kwargs) if isinstance(v, DictConfig) else v for k, v in config.items()} |
