Unverified Commit cf04a43f authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

Fixing linters. (#2650)

parent 58848cb4
...@@ -2186,4 +2186,4 @@ ...@@ -2186,4 +2186,4 @@
"description": "Hugging Face Text Generation Inference API" "description": "Hugging Face Text Generation Inference API"
} }
] ]
} }
\ No newline at end of file
...@@ -619,18 +619,11 @@ class CausalLM(Model): ...@@ -619,18 +619,11 @@ class CausalLM(Model):
model_id, model_id,
revision=revision, revision=revision,
torch_dtype=dtype, torch_dtype=dtype,
device_map=( device_map=("auto" if device_count > 1 else None),
"auto"
if device_count > 1
else None
),
load_in_8bit=quantize == "bitsandbytes", load_in_8bit=quantize == "bitsandbytes",
trust_remote_code=trust_remote_code, trust_remote_code=trust_remote_code,
) )
if ( if device_count == 1 and quantize != "bitsandbytes":
device_count == 1
and quantize != "bitsandbytes"
):
model = model.to(device) model = model.to(device)
if tokenizer.pad_token_id is None: if tokenizer.pad_token_id is None:
......
...@@ -649,11 +649,7 @@ class Seq2SeqLM(Model): ...@@ -649,11 +649,7 @@ class Seq2SeqLM(Model):
model_id, model_id,
revision=revision, revision=revision,
torch_dtype=dtype, torch_dtype=dtype,
device_map=( device_map=("auto" if device_count > 1 else None),
"auto"
if device_count > 1
else None
),
load_in_8bit=quantize == "bitsandbytes", load_in_8bit=quantize == "bitsandbytes",
trust_remote_code=trust_remote_code, trust_remote_code=trust_remote_code,
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment