Skip to content

Commit

Permalink
add assert for missing tokenizer_type in config
Browse files Browse the repository at this point in the history
  • Loading branch information
AI_WAIFU committed Sep 4, 2024
1 parent c786367 commit d975955
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 d975955

Please sign in to comment.