Skip to content

Commit 7ddb2b1

Browse files
authored
Replace deprecated torch_dtype parameter with dtype (#3415)
- Update huggingface.py to use dtype instead of torch_dtype (2 places) - Update optimum_ipex.py to use dtype instead of torch_dtype (1 place) - Aligns with Transformers v4.56.0+ API and removes deprecation warnings
1 parent 2caff2b commit 7ddb2b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lm_eval/models/huggingface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def _create_model(
628628
self._model = self.AUTO_MODEL_CLASS.from_pretrained(
629629
pretrained,
630630
revision=revision,
631-
torch_dtype=get_dtype(dtype),
631+
dtype=get_dtype(dtype),
632632
trust_remote_code=trust_remote_code,
633633
gguf_file=gguf_file,
634634
quantization_config=quantization_config,
@@ -712,7 +712,7 @@ def _create_model(
712712
_model_delta = self.AUTO_MODEL_CLASS.from_pretrained(
713713
delta,
714714
revision=revision,
715-
torch_dtype=get_dtype(dtype),
715+
dtype=get_dtype(dtype),
716716
trust_remote_code=trust_remote_code,
717717
**model_kwargs,
718718
)

lm_eval/models/optimum_ipex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _create_model(
7373
self._model = IPEXModelForCausalLM.from_pretrained(
7474
pretrained,
7575
revision=revision,
76-
torch_dtype=get_dtype(dtype),
76+
dtype=get_dtype(dtype),
7777
trust_remote_code=trust_remote_code,
7878
**model_kwargs,
7979
)

0 commit comments

Comments
 (0)