f"Using `accelerate launch` or `parallelize=True`, device '{device}' will be overridden when placing model."
f"Using `accelerate launch` or `parallelize=True`, device '{device}' will be overridden when placing model."
)
)
...
@@ -204,7 +205,12 @@ class HFLM(LM):
...
@@ -204,7 +205,12 @@ class HFLM(LM):
self.model.tie_weights()
self.model.tie_weights()
ifgpus<=1andnotparallelize:
ifgpus<=1andnotparallelize:
# place model onto device, if not using HF Accelerate in any form
# place model onto device, if not using HF Accelerate in any form
try:
self.model.to(self.device)
self.model.to(self.device)
exceptValueError:
eval_logger.info(
"Failed to place model onto specified device. This may be because the model is quantized via `bitsandbytes`. If the desired GPU is being used, this message is safe to ignore."
"Failed to place model onto specified device. This may be because the model is quantized via `bitsandbytes`. If the desired GPU is being used, this message is safe to ignore."