Skip to content

Commit a949d97

Browse files
committed
minor fix of eval device setting
Signed-off-by: He, Xin3 <[email protected]>
1 parent 616c813 commit a949d97

File tree

1 file changed

+3
-0
lines changed
  • examples/pytorch/nlp/huggingface_models/language-modeling/quantization/mix-precision

1 file changed

+3
-0
lines changed

examples/pytorch/nlp/huggingface_models/language-modeling/quantization/mix-precision/quantize.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def initialize_model_and_tokenizer(model_name_or_path):
103103

104104
model, tokenizer = initialize_model_and_tokenizer(args.model_name_or_path)
105105
device="hpu" if is_hpex_available() else "cuda"
106+
# in case that model is set to cuda:0 by default
107+
if args.device_map.isdigit() and device=="cuda":
108+
device = f"{device}:{args.device_map}"
106109

107110
if args.quantize:
108111
if args.dtype in ["uNVFP4", "NVFP4+"]:

0 commit comments

Comments
 (0)