Skip to content

Commit

Permalink
updated validation_tool and add exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ayissi-msft committed Sep 30, 2024
1 parent e1cb1b7 commit 6063694
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tools/python/model_validation/validation_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def validate_model(config, model_directory):

return generation_successful


def folder_exists(folder_path):
return os.path.isdir(folder_path)

Expand Down Expand Up @@ -133,12 +132,14 @@ def create_folder(folder_path):
output = []

for model in config["models"]:
# Wrap in a try catch
create_model(model, '', model_output_dir+f'/{model}', 'int4', 'cpu', model_cache_dir+f'/{model}')
generation_successful = validate_model(config, model_output_dir)
#Table values
output.append([model, generation_successful, "no"])
#columns, model name, validation complete (y/n), third - exception / failure msgs
try:
create_model(model, '', model_output_dir+f'/{model}', 'int4', 'cpu', model_cache_dir+f'/{model}')
generation_successful = validate_model(config, model_output_dir)
exception_message = None
except Exception as e:
exception_message = str(e)

output.append([model, generation_successful, exception_message])

df = create_table(output)
print(df)

0 comments on commit 6063694

Please sign in to comment.