nbansal commited on
Commit
d05159f
1 Parent(s): 4bf9a66
Files changed (1) hide show
  1. semf1.py +3 -3
semf1.py CHANGED
@@ -226,11 +226,11 @@ def _validate_input_format(
226
  raise ValueError(f"Predictions and references must have the same length. "
227
  f"Got {len(predictions)} predictions and {len(references)} references.")
228
 
229
- def is_list_of_strings_at_depth(lst_obj, depth: int):
230
- return is_nested_list_of_type(lst_obj, element_type=str, depth=depth)
231
 
232
  def check_format(lst_obj, expected_depth: int, name: str):
233
- is_valid, error_message = is_list_of_strings_at_depth(lst_obj, expected_depth)
234
  if not is_valid:
235
  raise ValueError(f"{name} are not in the expected format.\n"
236
  f"Error: {error_message}.")
 
226
  raise ValueError(f"Predictions and references must have the same length. "
227
  f"Got {len(predictions)} predictions and {len(references)} references.")
228
 
229
+ if len(predictions) == 0:
230
+ raise ValueError("Can't have empty inputs")
231
 
232
  def check_format(lst_obj, expected_depth: int, name: str):
233
+ is_valid, error_message = is_nested_list_of_type(lst_obj, element_type=str, depth=expected_depth)
234
  if not is_valid:
235
  raise ValueError(f"{name} are not in the expected format.\n"
236
  f"Error: {error_message}.")