From 1d94a67f86476bc00cb0e8143692e761bedf5f92 Mon Sep 17 00:00:00 2001 From: garyzhang99 <46197280+garyzhang99@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:26:22 +0800 Subject: [PATCH] set availablity checking from warning to error (#297) --- data_juicer/ops/load.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data_juicer/ops/load.py b/data_juicer/ops/load.py index f6a4bd3d9..4e9aa248a 100644 --- a/data_juicer/ops/load.py +++ b/data_juicer/ops/load.py @@ -1,3 +1,5 @@ +import sys + from loguru import logger from data_juicer.utils.availability_utils import UNAVAILABLE_OPERATORS @@ -21,8 +23,8 @@ def load_ops(process_list, op_fusion=False): for process in process_list: op_name, args = list(process.items())[0] if op_name in UNAVAILABLE_OPERATORS: - logger.warning(UNAVAILABLE_OPERATORS[op_name].get_warning_msg()) - continue + logger.error(UNAVAILABLE_OPERATORS[op_name].get_warning_msg()) + sys.exit(UNAVAILABLE_OPERATORS[op_name].get_warning_msg()) ops.append(OPERATORS.modules[op_name](**args)) new_process_list.append(process)