Skip to content

Commit 0d11c63

Browse files
xu-songawan-10mrwyattii
authored
Add default value for tokenizer path (deepspeedai#699)
Co-authored-by: Ammar Ahmad Awan <ammar.awan@microsoft.com> Co-authored-by: Michael Wyatt <mrwyattii@gmail.com>
1 parent ca03bd7 commit 0d11c63

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • applications/DeepSpeed-Chat/training/utils

applications/DeepSpeed-Chat/training/utils/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def load_hf_tokenizer(model_name_or_path, fast_tokenizer=True):
6969
model_json = os.path.join(model_name_or_path, "config.json")
7070
if os.path.exists(model_json):
7171
model_json_file = json.load(open(model_json))
72-
model_name = model_json_file["_name_or_path"]
72+
model_name = model_json_file.get("_name_or_path",
73+
model_name_or_path)
7374
tokenizer = get_tokenizer(model_name,
7475
fast_tokenizer=fast_tokenizer)
7576
else:

0 commit comments

Comments
 (0)