Skip to content

Commit 777fcaf

Browse files
cjluo-nvCopilot
andauthored
Update examples/llm_ptq/hf_ptq.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Chenjie Luo <108829653+cjluo-nv@users.noreply.github.com>
1 parent 76b9765 commit 777fcaf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

examples/llm_ptq/hf_ptq.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,12 +1132,15 @@ def parse_args() -> argparse.Namespace:
11321132
type=float,
11331133
default=1.0 / 4,
11341134
help=(
1135-
"Percentage of experts to calibrate during forward pass. Only used for MOE models. "
1136-
"This is used to reduce the number of experts to calibrate during forward pass. "
1135+
"Fraction of experts to calibrate during forward pass (ratio in (0.0, 1.0]). "
1136+
"Only used for MOE models; used to reduce the number of experts calibrated during the forward pass."
11371137
),
11381138
)
11391139

1140-
return parser.parse_args()
1140+
args = parser.parse_args()
1141+
if not (0.0 < args.moe_calib_experts_ratio <= 1.0):
1142+
parser.error("--moe_calib_experts_ratio must be in the range (0.0, 1.0].")
1143+
return args
11411144

11421145

11431146
def main(args: argparse.Namespace):

0 commit comments

Comments
 (0)