diff --git a/data_juicer/utils/model_utils.py b/data_juicer/utils/model_utils.py index e4038daac..492acb2e4 100644 --- a/data_juicer/utils/model_utils.py +++ b/data_juicer/utils/model_utils.py @@ -285,4 +285,8 @@ def get_model(model_key, lang='en', model_type='sentencepiece'): :param model_key: name of the model or tokenzier """ + if model_key is None: + return None + if model_key not in MODEL_ZOO: + prepare_model(lang=lang, model_type=model_type, model_key=model_key) return MODEL_ZOO.get(model_key, None)