Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you please provide some details about tokenizer between Megatron-lm and HF tokenizer? #2

Open
yeyunhu opened this issue Jun 29, 2023 · 2 comments

Comments

@yeyunhu
Copy link

yeyunhu commented Jun 29, 2023

  1. There are some different about megatron-lm tokenizer and HF tokenizer.
python llama/tools/preprocess_data.py \
       --input /mnt/workspace/{}.json \
       --output-prefix  \
       --vocab-file **gpt2-vocab.json** \
       --dataset-impl mmap \
       --tokenizer-type **GPT2BPETokenizer** \
       --merge-file gpt2-merges.txt \
       --append-eod
  1. I am confused about the provided tokenizer file in this repo llama/tokenizer, which is different from that of HF one.
@yeyunhu
Copy link
Author

yeyunhu commented Jun 29, 2023

My converted Llama model (hugging face) looks like this.

llama/
- config.json
- generation_config.json
- pytorch_model-00001-of-00002.bin
- pytorch_model-00002-of-00002.bin
- pytorch_model.bin.index.json
- special_tokens_map.json
- tokenizer.json
- tokenizer.model
- tokenizer_config.json

@MoFHeka
Copy link
Owner

MoFHeka commented Jul 14, 2023

You could write a new custom_pretrain_llama.py to add HF tokenizer in training step. Add it in build_train_iterable_loaders function or somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants