mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-11 13:30:35 +00:00
convert : remove AWQ remnants (#5768)
This commit is contained in:
parent
8ced9f7e32
commit
1e35d619a6
13
convert.py
13
convert.py
@ -1377,7 +1377,6 @@ def main(args_in: list[str] | None = None) -> None:
|
|||||||
# We currently only support Q8_0 output on little endian systems.
|
# We currently only support Q8_0 output on little endian systems.
|
||||||
output_choices.append("q8_0")
|
output_choices.append("q8_0")
|
||||||
parser = argparse.ArgumentParser(description="Convert a LLaMA model to a GGML compatible file")
|
parser = argparse.ArgumentParser(description="Convert a LLaMA model to a GGML compatible file")
|
||||||
parser.add_argument("--awq-path", type=Path, help="Path to scale awq cache file", default=None)
|
|
||||||
parser.add_argument("--dump", action="store_true", help="don't convert, just show what's in the model")
|
parser.add_argument("--dump", action="store_true", help="don't convert, just show what's in the model")
|
||||||
parser.add_argument("--dump-single", action="store_true", help="don't convert, just show what's in a single model file")
|
parser.add_argument("--dump-single", action="store_true", help="don't convert, just show what's in a single model file")
|
||||||
parser.add_argument("--vocab-only", action="store_true", help="extract only the vocab")
|
parser.add_argument("--vocab-only", action="store_true", help="extract only the vocab")
|
||||||
@ -1393,18 +1392,6 @@ def main(args_in: list[str] | None = None) -> None:
|
|||||||
parser.add_argument("--skip-unknown", action="store_true", help="skip unknown tensor names instead of failing")
|
parser.add_argument("--skip-unknown", action="store_true", help="skip unknown tensor names instead of failing")
|
||||||
|
|
||||||
args = parser.parse_args(args_in)
|
args = parser.parse_args(args_in)
|
||||||
if args.awq_path:
|
|
||||||
sys.path.insert(1, str(Path(__file__).parent / 'awq-py'))
|
|
||||||
from awq.apply_awq import add_scale_weights # type: ignore[import-not-found]
|
|
||||||
tmp_model_path = args.model / "weighted_model"
|
|
||||||
if tmp_model_path.is_dir():
|
|
||||||
print(f"{tmp_model_path} exists as a weighted model.")
|
|
||||||
else:
|
|
||||||
tmp_model_path.mkdir(parents=True, exist_ok=True)
|
|
||||||
print("Saving new weighted model ...")
|
|
||||||
add_scale_weights(str(args.model), str(args.awq_path), str(tmp_model_path))
|
|
||||||
print(f"Saved weighted model at {tmp_model_path}.")
|
|
||||||
args.model = tmp_model_path
|
|
||||||
|
|
||||||
if args.dump_single:
|
if args.dump_single:
|
||||||
model_plus = lazy_load_file(args.model)
|
model_plus = lazy_load_file(args.model)
|
||||||
|
Loading…
Reference in New Issue
Block a user