Skip to content

Commit

Permalink
Merge pull request ContextualAI#37 from kabachuha/patch-1
Browse files Browse the repository at this point in the history
[Fix] Don't use model .to( device when using bitsandbytes quant
  • Loading branch information
Muennighoff authored Jun 3, 2024
2 parents 9883da1 + ea17214 commit da37ccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gritlm/gritlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
if self.embed_eos:
assert self.embed_eos in self.tokenizer.vocab, f"EOS token {self.embed_eos} not in vocab"
self.model.eval()
if not("device_map" in kwargs):
if not("device_map" in kwargs) and not(kwargs.get("load_in_4bit", False)) and not(kwargs.get("load_in_8bit", False)):
self.model.to(self.device)
# Parallelize embedding model
if mode == 'embedding':
Expand Down

0 comments on commit da37ccb

Please sign in to comment.