From 21b225ac45052a888c2a4e83e04630eff458536a Mon Sep 17 00:00:00 2001 From: nimlgen <138685161+nimlgen@users.noreply.github.com> Date: Wed, 26 Jun 2024 22:45:13 +0300 Subject: [PATCH] llama3 download works (#5160) --- examples/llama3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/llama3.py b/examples/llama3.py index e118dfeeee..04909758f7 100644 --- a/examples/llama3.py +++ b/examples/llama3.py @@ -209,7 +209,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--download_model", action="store_true", help="Download a 8B model") - parser.add_argument("--model", type=Path, required=True, help="Model path") + parser.add_argument("--model", type=Path, help="Model path") parser.add_argument("--size", choices=["8B", "70B"], default="8B", help="Model size") parser.add_argument("--shard", type=int, default=1, help="Shard the model across multiple devices") parser.add_argument("--quantize", choices=["int8", "nf4"], help="Quantization method") @@ -232,6 +232,8 @@ if __name__ == "__main__": fetch("https://huggingface.co/TriAiExperiments/SFR-Iterative-DPO-LLaMA-3-8B-R/resolve/main/model-00004-of-00004.safetensors", "model-00004-of-00004.safetensors", subdir="llama3-8b-sfr") args.model = fetch("https://huggingface.co/TriAiExperiments/SFR-Iterative-DPO-LLaMA-3-8B-R/raw/main/model.safetensors.index.json", "model.safetensors.index.json", subdir="llama3-8b-sfr") + assert args.model is not None, "please provide --model option" + if args.seed is not None: Tensor.manual_seed(args.seed) if args.benchmark: Tensor.manual_seed(42) print(f"seed = {Tensor._seed}")