File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,7 @@ def write_file_metadata_json(
470
470
model_prefix : str ,
471
471
json_path : Union [str , Path , None ] = None ,
472
472
is_h2o_model : Optional [bool ] = False ,
473
+ is_pytorch_model : Optional [bool ] = False ,
473
474
is_tf_keras_model : Optional [bool ] = False ,
474
475
) -> Union [dict , None ]:
475
476
"""
@@ -489,6 +490,10 @@ def write_file_metadata_json(
489
490
Sets whether the model metadata is associated with an H2O.ai model. If set
490
491
as True, the MOJO model file will be set as a score resource. The default
491
492
value is False.
493
+ is_pytorch_model : bool, optional
494
+ Sets whether the model metadata is associated with an H2O.ai model. If set
495
+ as True, the .pth file will be set as a score resource. The default
496
+ value is False.
492
497
493
498
Returns
494
499
-------
@@ -505,6 +510,8 @@ def write_file_metadata_json(
505
510
dict_list .append ({"role" : "scoreResource" , "name" : model_prefix + ".mojo" })
506
511
elif is_tf_keras_model :
507
512
dict_list .append ({"role" : "scoreResource" , "name" : model_prefix + ".h5" })
513
+ elif is_pytorch_model :
514
+ dict_list .append (({"role" : "scoreResource" , "name" : model_prefix + ".pth" }))
508
515
else :
509
516
dict_list .append (
510
517
{"role" : "scoreResource" , "name" : model_prefix + ".pickle" }
You can’t perform that action at this time.
0 commit comments