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

[Bugfix] fix qwen tokenizer config when converting to nemo format #11098

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/checkpoint_converters/convert_qwen2_hf_to_nemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ def load_config(args, qwen_config):
nemo_config.num_query_groups = qwen_config['num_key_value_heads']
nemo_config.use_cpu_initialization = True
nemo_config.activation = 'fast-swiglu'
nemo_config.tokenizer.type = str(args.input_name_or_path)
nemo_config.tokenizer.model = str(args.input_name_or_path) + '/vocab.json'

# use HF tokenizer
tokenizer_dict = {
'library': 'huggingface',
'type': args.input_name_or_path,
'use_fast': True,
'trust_remote_code': True,
}
nemo_config.tokenizer = tokenizer_dict

nemo_config.override_vocab_size = qwen_config['vocab_size']

base = 128
Expand Down
Loading