Skip to content

Commit

Permalink
get_nmt_tokenizer; Improve error message.
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
  • Loading branch information
akoumpa committed Jan 30, 2024
1 parent 1655d6c commit 3bb3b11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nemo/collections/nlp/modules/common/tokenizer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ def get_nmt_tokenizer(
if (library != 'byte-level') and (
model_name is None and (tokenizer_model is None or not os.path.isfile(tokenizer_model))
):
raise ValueError("No Tokenizer path provided or file does not exist!")
if tokenizer_model is None:
error_message = "No Tokenizer path provided!"
else:
error_message = f"Tokenizer path ({tokenizer_model}) does not exist!"
raise ValueError(error_message)

if library == 'yttm':
logging.info(f'Getting YouTokenToMeTokenizer with model: {tokenizer_model} with r2l: {r2l}.')
Expand Down

0 comments on commit 3bb3b11

Please sign in to comment.