File tree 1 file changed +7
-3
lines changed
extensions/tokenizers/src/main/python/djl_converter
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def main():
43
43
44
44
if os .listdir (output_dir ):
45
45
logging .error (f"output directory: { output_dir } is not empty." )
46
- return
46
+ return False
47
47
48
48
if os .path .exists (args .model_id ):
49
49
logging .info (f"converting local model: { args .model_id } " )
@@ -66,7 +66,7 @@ def main():
66
66
if not task :
67
67
logging .error (
68
68
f"Unsupported model architecture: { arch } for { args .model_id } ." )
69
- return
69
+ return False
70
70
71
71
converter = SUPPORTED_TASKS [task ]
72
72
@@ -75,12 +75,16 @@ def main():
75
75
output_dir , False )
76
76
if result :
77
77
logging .info (f"Convert model { model_info .modelId } finished." )
78
+ return True
78
79
else :
79
80
logging .error (f"{ model_info .modelId } : { reason } " )
80
81
except Exception as e :
81
82
logging .warning (f"Failed to convert model: { model_info .modelId } ." )
82
83
logging .warning (e , exc_info = True )
83
84
85
+ return False
86
+
84
87
85
88
if __name__ == "__main__" :
86
- main ()
89
+ if not main ():
90
+ sys .exit (1 )
You can’t perform that action at this time.
0 commit comments