Skip to content

Commit f9a0362

Browse files
committed
Correcting device_map conflict in local model extra kwargs
1 parent b249146 commit f9a0362

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dsp/modules/hf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def __init__(
6161
hf_autoconfig_kwargs = dict(token=token or os.environ.get("HF_TOKEN"))
6262
hf_autotokenizer_kwargs = hf_autoconfig_kwargs.copy()
6363
hf_automodel_kwargs = hf_autoconfig_kwargs.copy()
64+
65+
# silently remove device_map from model_kwargs if it is present, as the option is provided in the constructor
66+
if "device_map" in model_kwargs:
67+
model_kwargs.pop("device_map")
6468
hf_automodel_kwargs.update(model_kwargs)
6569
if not self.is_client:
6670
try:

0 commit comments

Comments
 (0)