Skip to content

Commit ecffd3d

Browse files
authored
fix lm_head not initialize issue (#4674)
1 parent b17216c commit ecffd3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/gpu/llm/inference/run_generation_with_deepspeed.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ def print_mem_usage(msg):
201201
tokenizer = model_class[1].from_pretrained(model_name)
202202
config = AutoConfig.from_pretrained(model_name, torchscript=args.jit)
203203
# Avoid deepspeed tp>=2 lm_head weight reload. Not affect the results.
204-
config.tie_word_embeddings = False
204+
if not args.disable_optimize_transformers:
205+
config.tie_word_embeddings = False
205206
#if not hasattr(config, "text_max_length") and args.prompt is None:
206207
# config.text_max_length = int(args.input_tokens) + int(args.max_new_tokens)
207208
print_rank0("*** model config:", config)

0 commit comments

Comments
 (0)