!44988 fix log issue of dynamic obfuscation

Merge pull request !44988 from jxlang910/master
This commit is contained in:
i-robot 2022-11-02 08:03:31 +00:00 committed by Gitee
commit d2bce06ac7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 4 deletions

View File

@ -609,8 +609,8 @@ def obfuscate_model(obf_config, **kwargs):
raise TypeError("The item in 'model_inputs' must be Tensor, but got {}.".format(type(item)))
obf_ratio, customized_funcs, obf_password = _check_obfuscate_params(obf_config)
if customized_funcs and obf_password > 0:
logger.warning("Although customized_func and obf_password are set, the 'obf_password' mode would be"
"applied, remember to set obf_password when loading obfuscated model.")
logger.warning("Although 'customized_func' and 'obf_password' are set, the 'obf_password' mode would be"
" applied, remember to set 'obf_password' when loading obfuscated model.")
if obf_password == 0: # apply customized_func mode
clean_funcs()
@ -1370,8 +1370,8 @@ def _set_obfuscate_config(**kwargs):
"but got {}.".format(enc_mode))
obf_ratio, customized_funcs, obf_password = _check_obfuscate_params(kwargs.get('obf_config'))
if customized_funcs and obf_password > 0:
logger.warning("Although customized_func and obf_password are set, the 'obf_password' mode would be"
"applied, remember to set obf_password when loading obfuscated model.")
logger.warning("Although 'customized_func' and 'obf_password' are set, the 'obf_password' mode would be"
" applied, remember to set 'obf_password' when loading obfuscated model.")
if obf_password == 0: # apply customized_func mode
clean_funcs()