Skip to content

Commit 2b4abc6

Browse files
authored
Fix "has no attribute startswith" (#2498)
The value needs to be converted to string first.
1 parent 1e3d06d commit 2b4abc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mmdeploy/utils/config_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_codebase(deploy_cfg: Union[str, mmengine.Config],
9797
# using mmrazor codebase if the model is a mmrazor model.
9898
model_cfg: dict = model_cfg['model']
9999
if model_cfg.get('_scope_', None) == 'mmrazor'\
100-
or model_cfg['type'].startswith('mmrazor.'):
100+
or str(model_cfg['type']).startswith('mmrazor.'):
101101
return register_codebase('mmrazor')
102102
codebase_config = get_codebase_config(deploy_cfg)
103103
assert 'type' in codebase_config, 'The codebase config of deploy config'\

0 commit comments

Comments
 (0)