Skip to content

Commit

Permalink
add assert for missing tokenizer_type in config (#1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-WAIFU authored Sep 5, 2024
1 parent c786367 commit 7548a8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions megatron/tokenizer/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def build_tokenizer(args):
"""Initialize tokenizer."""
if args.rank == 0:
print("> building {} tokenizer ...".format(args.tokenizer_type), flush=True)

assert args.tokenizer_type is not None, "tokenizer_type must be specified in the .yml config"

# Select and instantiate the tokenizer.
if args.tokenizer_type.lower() == "GPT2BPETokenizer".lower():
Expand Down

0 comments on commit 7548a8b

Please sign in to comment.