Spaces:
Runtime error
Runtime error
Minor
Browse files
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 |
-
|
| 230 |
-
|
| 231 |
|
| 232 |
def check_format(lst_obj, expected_depth: int, name: str):
|
| 233 |
-
is_valid, error_message =
|
| 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}.")
|