Fixing linters. (#2650)
This commit is contained in:
parent
58848cb471
commit
cf04a43fb1
|
@ -2186,4 +2186,4 @@
|
|||
"description": "Hugging Face Text Generation Inference API"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue