diff options
| author | Djshinshin <129614060+Djshinshin@users.noreply.github.com> | 2026-08-14 14:53:07 +0800 |
|---|---|---|
| committer | Djshinshin <129614060+Djshinshin@users.noreply.github.com> | 2026-08-14 14:53:07 +0800 |
| commit | bfb5c696856e9eb09c02574f8c4704cdeb60e389 (patch) | |
| tree | 1af16325f0902238c398ba1f17ec23c249f92073 /look2hear/utils/parser_utils.py | |
| parent | 17de0fc5470cbd2671b8a19743ac3a6f8885e534 (diff) | |
| download | apollo-gfx803-bfb5c696856e9eb09c02574f8c4704cdeb60e389.tar.gz | |
Refine Traditional Chinese documentation scope
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 e59ff09..aa99670 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()} + # 对于不包含 '__target__' 的字典,递归处理其每个值 + return {k: instantiate(v, **kwargs) if isinstance(v, DictConfig) else v for k, v in config.items()}
\ No newline at end of file |
