Unverified Commit f2853995 authored by Jaewoo Yang's avatar Jaewoo Yang Committed by GitHub
Browse files

fix unbounded local variable (#1218)

parent af74a93d
...@@ -201,7 +201,7 @@ class HFLM(LM): ...@@ -201,7 +201,7 @@ class HFLM(LM):
self.model.eval() self.model.eval()
self.model.tie_weights() self.model.tie_weights()
if (gpus >= 1 or str(self.device) == "mps") and isinstance(pretrained, str): if isinstance(pretrained, str) and (gpus >= 1 or str(self.device) == "mps"):
if not (parallelize or autogptq or ("device_map" in kwargs)): if not (parallelize or autogptq or ("device_map" in kwargs)):
# place model onto device requested manually, # place model onto device requested manually,
# if not using HF Accelerate or device_map # if not using HF Accelerate or device_map
......
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