File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
libraries/mathy_python/mathy/agents Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -189,16 +189,18 @@ def get_or_create_policy_model(
189189 init_model_path = os .path .join (args .init_model_from , args .model_name )
190190 opt = f"{ init_model_path } .optimizer"
191191 mod = f"{ init_model_path } .h5"
192- if os .path .exists (f"{ model_path } .h5" ):
192+ cfg = f"{ init_model_path } .config.json"
193+ if os .path .exists (f"{ model_path } .bytes" ):
193194 print_error (
194195 ValueError ("Model Exists" ),
195196 f"Cannot initialize on top of model: { model_path } " ,
196197 print_error = False ,
197198 )
198- if os .path .exists (opt ) and os .path .exists (mod ):
199+ if os .path .exists (opt ) and os .path .exists (mod ) and os . path . exists ( cfg ) :
199200 print (f"initialize model from: { init_model_path } " )
200201 copyfile (opt , f"{ model_path } .optimizer" )
201202 copyfile (mod , f"{ model_path } .h5" )
203+ copyfile (cfg , f"{ model_path } .config.json" )
202204 else :
203205 print_error (
204206 ValueError ("Model Exists" ),
You can’t perform that action at this time.
0 commit comments