From 4a03e00aa1e5f39f6506eed30f7b0a38108cbb8d Mon Sep 17 00:00:00 2001 From: chenyu Date: Sun, 27 Oct 2024 11:20:24 -0400 Subject: [PATCH] fix llama3 download_model assert (#7320) false positive if download_model and model are not provided --- examples/llama3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/llama3.py b/examples/llama3.py index 712a1df435..dcdf439988 100644 --- a/examples/llama3.py +++ b/examples/llama3.py @@ -217,7 +217,7 @@ if __name__ == "__main__": Tensor.no_grad = True parser = argparse.ArgumentParser() - parser.add_argument("--download_model", action="store_true", help="Download a 8B model") + parser.add_argument("--download_model", action="store_true", help="Download a model") parser.add_argument("--model", type=Path, help="Model path") parser.add_argument("--size", choices=["1B", "8B", "70B"], default="8B", help="Model size") parser.add_argument("--shard", type=int, default=1, help="Shard the model across multiple devices") @@ -233,7 +233,7 @@ if __name__ == "__main__": parser.add_argument("--profile", action="store_true", help="Output profile data") args = parser.parse_args() - assert not (args.download_model and args.model), "either download or provide model" + assert (args.model and not args.download_model) or (not args.model and args.download_model), "either download or provide model" if args.download_model: if args.size == "1B": fetch("https://huggingface.co/bofenghuang/Meta-Llama-3-8B/resolve/main/original/tokenizer.model", "tokenizer.model", subdir="llama3-1b-instruct")