Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve exception messages for better readability and error context #556

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions eval_mm/vqaeval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

def get_model(args):
if args.model_name == '':
raise Exception('Model name cannot be empty str!')
raise ValueError('Model name cannot be an empty string!')
from models.MiniCPM.minicpmv import MiniCPM_V, MiniCPM_V_2_6
model_path = args.model_path
ckpt = args.ckpt
Expand All @@ -31,7 +31,7 @@ def get_model(args):
elif args.model_name == 'minicpmv26':
model = MiniCPM_V_2_6(model_path=model_path, ckpt=ckpt, device=args.device)
else:
raise Exception(f"Unexpected Moedel Name {args.model_name}!")
raise ValueError(f"Unexpected Model Name: {args.model_name}!")

return model

Expand Down Expand Up @@ -100,4 +100,5 @@ def main(args):
if __name__ == "__main__":
args = parse_args()

main(args)
main(args)