File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -562,11 +562,13 @@ def _viya35_model_load(
562
562
f'{ model_id } /{ model_file_name } ")))'
563
563
)
564
564
elif pytorch_model :
565
- cls .score_code += ("model = torch.load(path) " )
565
+ cls .score_code += (
566
+ f"model = torch.load(\" /models/resources/viya/{ model_id } /\" + "
567
+ f"{ model_file_name } )\n \n "
568
+ )
566
569
return (
567
- f"{ '' :8} model_path = Path(\" /models/resources/viya/{ model_id } \" )\n "
568
- f"{ '' :8} with open(model_path / \" model.pth\" , \" rb\" ) as torch_model:\n "
569
- f"{ '' :12} model = torch.load(torch_model)"
570
+ f"{ '' :8} model = torch.load(\" /models/resources/viya/{ model_id } /\" + "
571
+ f"{ model_file_name } )\n \n "
570
572
)
571
573
else :
572
574
cls .score_code += (
@@ -655,11 +657,13 @@ def _viya4_model_load(
655
657
f"{ model_file_name } ))\n \n "
656
658
)
657
659
elif pytorch_model :
658
- cls .score_code += ("model = torch.load(path) " )
660
+ cls .score_code += (
661
+ f"model = torch.load(Path(settings.pickle_path) / "
662
+ f"{ model_file_name } )\n \n "
663
+ )
659
664
return (
660
- f"{ '' :8} model_path = Path(\" /models/resources/viya/{ model_id } \" )\n "
661
- f"{ '' :8} with open(model_path / \" model.pth\" , \" rb\" ) as torch_model:\n "
662
- f"{ '' :12} model = torch.load(torch_model)"
665
+ f"{ '' :8} model = torch.load(Path(settings.pickle_path) / "
666
+ f"{ model_file_name } )\n \n "
663
667
)
664
668
elif tf_keras_model :
665
669
cls .score_code += (
You can’t perform that action at this time.
0 commit comments