Skip to content

Commit 943703b

Browse files
Michael Gschwindfacebook-github-bot
authored andcommitted
No hardcoded default checkpoints (#2708)
Summary: No hardcoded default checkpoints Reviewed By: cpuhrsch Differential Revision: D55409487
1 parent 853fb5b commit 943703b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/models/llama2/export_llama_lib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import argparse
1010
import copy
1111
import logging
12+
import os
1213
import shlex
1314
from dataclasses import dataclass
1415

@@ -237,8 +238,10 @@ def quantize(
237238
else:
238239
torch_dtype = torch.float16
239240

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

243246
if calibration_tasks is None:
244247
calibration_tasks = ["wikitext"]

0 commit comments

Comments
 (0)