Skip to content

Commit

Permalink
quantization: instantiate model on CPU (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-vi authored Apr 19, 2023
1 parent 06302ea commit 64636f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ def main(
else:
raise RuntimeError(f"unknown/unsupported quantization mode {quantize}")

# we avoid loading the entire model on the GPU and do this block by block
with EmptyInitOnDevice(
device=device,
device="cpu",
dtype=dtype,
):
print("Loading model ...", file=sys.stderr)
Expand Down

0 comments on commit 64636f1

Please sign in to comment.