Skip to content

Commit 201ca6e

Browse files
mikekgfbmalfet
authored andcommitted
Precision control (#126)
* macos12 full build (x86) * add support for setting precision via --dtype * setup default dtype as float32 * setup default dtype as float32
1 parent 067f41a commit 201ca6e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def cli():
167167
parser.add_argument(
168168
"-d",
169169
"--dtype",
170-
default=None,
170+
default="float32",
171171
help="Override the dtype of the model (default is the checkpoint dtype). Options: bf16, fp16, fp32",
172172
)
173173
parser.add_argument("-v", "--verbose", action="store_true")

generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def cli():
603603
parser.add_argument(
604604
"-d",
605605
"--dtype",
606-
default=None,
606+
default="float32",
607607
help="Override the dtype of the model (default is the checkpoint dtype). Options: bf16, fp16, fp32",
608608
)
609609

quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def name_to_dtype(name):
3737
if name in name_to_dtype_dict:
3838
return name_to_dtype_dict[name]
3939
else:
40-
raise RuntimeError("unsupported dtype specified")
40+
raise RuntimeError(f"unsupported dtype name {name} specified")
4141

4242
name_to_dtype_dict = {
4343
"fp32" : torch.float,

0 commit comments

Comments
 (0)