Fixing linters.

This commit is contained in:
Nicolas Patry 2024-10-15 12:26:32 +02:00
parent 58848cb471
commit 39b86f7f16
No known key found for this signature in database
GPG Key ID: D2920555C90F704C
3 changed files with 4 additions and 15 deletions

View File

@ -619,18 +619,11 @@ class CausalLM(Model):
model_id,
revision=revision,
torch_dtype=dtype,
device_map=(
"auto"
if device_count > 1
else None
),
device_map=("auto" if device_count > 1 else None),
load_in_8bit=quantize == "bitsandbytes",
trust_remote_code=trust_remote_code,
)
if (
device_count == 1
and quantize != "bitsandbytes"
):
if device_count == 1 and quantize != "bitsandbytes":
model = model.to(device)
if tokenizer.pad_token_id is None:

View File

@ -649,11 +649,7 @@ class Seq2SeqLM(Model):
model_id,
revision=revision,
torch_dtype=dtype,
device_map=(
"auto"
if device_count > 1
else None
),
device_map=("auto" if device_count > 1 else None),
load_in_8bit=quantize == "bitsandbytes",
trust_remote_code=trust_remote_code,
)