File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ def getFiles(extensions):
255
255
Path (pyPath ) / (modelPrefix + "Score.py" )
256
256
)
257
257
)
258
- zipIOFile = zm .zipFiles (Path (zPath ), modelPrefix )
258
+ zipIOFile = zm .zipFiles (Path (zPath ), modelPrefix , isViya4 = True )
259
259
print ("All model files were zipped to {}." .format (Path (zPath )))
260
260
261
261
# Check if project name provided exists and raise an error or create a new project
@@ -276,7 +276,7 @@ def getFiles(extensions):
276
276
print ("Model failed to import to SAS Model Manager." )
277
277
# For SAS Viya 3.5, the score code is written after upload in order to know the model UUID
278
278
else :
279
- zipIOFile = zm .zipFiles (Path (zPath ), modelPrefix )
279
+ zipIOFile = zm .zipFiles (Path (zPath ), modelPrefix , isViya4 = False )
280
280
print ("All model files were zipped to {}." .format (Path (zPath )))
281
281
282
282
# Check if project name provided exists and raise an error or create a new project
Original file line number Diff line number Diff line change 11
11
12
12
class ZipModel :
13
13
@staticmethod
14
- def zipFiles (fileDir , modelPrefix ):
14
+ def zipFiles (fileDir , modelPrefix , isViya4 = False ):
15
15
"""
16
16
Combines all JSON files with the model pickle file and associated score code file
17
17
into a single archive ZIP file.
@@ -23,6 +23,10 @@ def zipFiles(fileDir, modelPrefix):
23
23
modelPrefix : string
24
24
Variable name for the model to be displayed in SAS Open Model Manager
25
25
(i.e. hmeqClassTree + [Score.py || .pickle]).
26
+ isViya4 : boolean, optional
27
+ Boolean to indicate difference in logic between SAS Viya 3.5 and SAS Viya 4.
28
+ For Viya 3.5 models, ignore score code that is already in place in the file
29
+ directory provided. Default value is False.
26
30
27
31
Yields
28
32
---------------
@@ -33,7 +37,8 @@ def zipFiles(fileDir, modelPrefix):
33
37
34
38
fileNames = []
35
39
fileNames .extend (sorted (Path (fileDir ).glob ("*.json" )))
36
- fileNames .extend (sorted (Path (fileDir ).glob ("*Score.py" )))
40
+ if isViya4 :
41
+ fileNames .extend (sorted (Path (fileDir ).glob ("*Score.py" )))
37
42
fileNames .extend (sorted (Path (fileDir ).glob ("*.pickle" )))
38
43
# Include H2O.ai MOJO files
39
44
fileNames .extend (sorted (Path (fileDir ).glob ("*.mojo" )))
You can’t perform that action at this time.
0 commit comments