“WadoodAbdul” commited on
Commit
17c27e0
1 Parent(s): f738aa2

added model name check on submission

Browse files
Files changed (1) hide show
  1. src/submission/submit.py +5 -2
src/submission/submit.py CHANGED
@@ -96,8 +96,11 @@ def add_new_eval(
96
  if not model_on_hub:
97
  return styled_error(f'Model "{model}" {error}')
98
  else:
99
- if len(list(API.list_models(model_name=model))) !=1:
100
- return styled_error(f'Model "{model}" does not exist on the hub!')
 
 
 
101
 
102
 
103
  # Is the model info correctly filled?
 
96
  if not model_on_hub:
97
  return styled_error(f'Model "{model}" {error}')
98
  else:
99
+ model_name_matches = list(API.list_models(model_name=model))
100
+ if len(model_name_matches) < 1:
101
+ return styled_error(f'Model "{model}" does not exist on the hub!')
102
+ elif model_name_matches[0].id != model:
103
+ return styled_error(f'Model "{model}" does not exist on the hub! There might be a typo in the name')
104
 
105
 
106
  # Is the model info correctly filled?