Skip to content

Commit

Permalink
convert-hf-to-gguf.py: add option to override architecture
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed May 24, 2024
1 parent a34d58e commit 1fc902f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,10 @@ def parse_args() -> argparse.Namespace:
"--no-lazy", action="store_true",
help="use more RAM by computing all outputs before writing (use in case lazy evaluation is broken)",
)
parser.add_argument(
"--architecture", type=str, default=None,
help="force the architecture to use",
)
parser.add_argument(
"--model-name", type=str, default=None,
help="name of the model",
Expand Down Expand Up @@ -2619,7 +2623,7 @@ def main() -> None:
hparams = Model.load_hparams(dir_model)

with torch.inference_mode():
model_class = Model.from_model_architecture(hparams["architectures"][0])
model_class = Model.from_model_architecture(args.architecture if args.architecture is not None else hparams["architectures"][0])
model_instance = model_class(dir_model, ftype_map[args.outtype], fname_out, args.bigendian, args.use_temp_file, args.no_lazy)

logger.info("Set model parameters")
Expand Down

0 comments on commit 1fc902f

Please sign in to comment.