Skip to content

Commit d4a7633

Browse files
dtzareedorenko
authored andcommitted
Fix validate logic for no model found (#111)
1 parent 6c56eee commit d4a7633

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

code/register/register_model.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ def main():
109109
if (validate):
110110
try:
111111
tag_name = 'BuildId'
112-
get_model_by_tag(model_name, tag_name, build_id, exp.workspace)
113-
print("Model was registered for this build.")
112+
model = get_model_by_tag(
113+
model_name, tag_name, build_id, exp.workspace)
114+
if (model is not None):
115+
print("Model was registered for this build.")
116+
if (model is None):
117+
print("Model was not registered for this run.")
118+
sys.exit(1)
114119
except Exception as e:
115120
print(e)
116121
print("Model was not registered for this run.")

0 commit comments

Comments
 (0)