File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ def __init__(
2727 super ().__init__ (use_cache = use_cache )
2828
2929 if dp_model_file_name is None and dp_model is None :
30- raise AttributeError ("`model_name ` or `model ` should be specified." )
30+ raise AttributeError ("`dp_model_file_name ` or `dp_model ` should be specified." )
3131 if dp_model_file_name is not None and dp_model is not None :
3232 raise AttributeError (
33- "`model_name ` and `model ` cannot be used simultaneously."
33+ "`dp_model_file_name ` and `dp_model ` cannot be used simultaneously."
3434 )
3535
3636 if dp_model is not None :
@@ -42,8 +42,9 @@ def __init__(
4242 raise ValueError (
4343 f"DPModifier only support standard model. Unsupported model type: { model_type } "
4444 )
45+ fitting_type = data ["model" ].get ("fitting" , {}).get ("type" , "ener" )
4546 self ._model = (
46- BaseModel .get_class_by_type (data [ "model" ][ "fitting" ][ "type" ] )
47+ BaseModel .get_class_by_type (fitting_type )
4748 .deserialize (data ["model" ])
4849 .to (env .DEVICE )
4950 )
You can’t perform that action at this time.
0 commit comments