This commit is contained in:
Trần Đức Nam 2023-12-19 14:51:52 +07:00
parent f8cf783935
commit 1b300cbd58

View file

@ -996,6 +996,8 @@ def parse_args() -> argparse.Namespace:
args = parse_args() args = parse_args()
dir_model = args.model
if args.awq_path: if args.awq_path:
from awqpy.apply_awq import add_scale_weights from awqpy.apply_awq import add_scale_weights
tmp_model_path = args.model / "weighted_model" tmp_model_path = args.model / "weighted_model"
@ -1008,8 +1010,6 @@ if args.awq_path:
add_scale_weights(str(args.model), str(args.awq_path), str(tmp_model_path)) add_scale_weights(str(args.model), str(args.awq_path), str(tmp_model_path))
print(f"Saved weighted model at {tmp_model_path}.") print(f"Saved weighted model at {tmp_model_path}.")
dir_model = tmp_model_path dir_model = tmp_model_path
else:
dir_model = args.model
if not dir_model.is_dir(): if not dir_model.is_dir():
print(f'Error: {args.model} is not a directory', file=sys.stderr) print(f'Error: {args.model} is not a directory', file=sys.stderr)