Skip to content

Commit 8806e6c

Browse files
Michael Gschwindfacebook-github-bot
authored andcommitted
No hardcoded default checkpoints
Summary: No hardcoded default checkpoints Reviewed By: cpuhrsch Differential Revision: D55409487
1 parent 853fb5b commit 8806e6c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/models/llama2/export_llama_lib.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ def quantize(
237237
else:
238238
torch_dtype = torch.float16
239239

240-
if checkpoint_path is None:
241-
checkpoint_path = Path("checkpoints/meta-llama/Llama-2-7b-chat-hf/model.pth")
240+
assert checkpoint_path, "Need to specify a checkpoint"
241+
assert os.path.isfile(checkpoint_path), f"{checkpoint_path} does not exist"
242+
# if checkpoint_path is None:
243+
# checkpoint_path = Path("checkpoints/meta-llama/Llama-2-7b-chat-hf/model.pth")
242244

243245
if calibration_tasks is None:
244246
calibration_tasks = ["wikitext"]

0 commit comments

Comments
 (0)