Skip to content

Commit

Permalink
Fix "has no attribute startswith" (#2498)
Browse files Browse the repository at this point in the history
The value needs to be converted to string first.
  • Loading branch information
Y-T-G authored Dec 21, 2023
1 parent 1e3d06d commit 2b4abc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmdeploy/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_codebase(deploy_cfg: Union[str, mmengine.Config],
# using mmrazor codebase if the model is a mmrazor model.
model_cfg: dict = model_cfg['model']
if model_cfg.get('_scope_', None) == 'mmrazor'\
or model_cfg['type'].startswith('mmrazor.'):
or str(model_cfg['type']).startswith('mmrazor.'):
return register_codebase('mmrazor')
codebase_config = get_codebase_config(deploy_cfg)
assert 'type' in codebase_config, 'The codebase config of deploy config'\
Expand Down

0 comments on commit 2b4abc6

Please sign in to comment.