mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 19:04:19 +00:00
initial changes (#261)
Update the parsing logic for comma-separated list and download function
This commit is contained in:
parent
319a6b5f83
commit
a07dfffbbf
1 changed files with 21 additions and 19 deletions
|
@ -152,27 +152,29 @@ def run_download_cmd(args: argparse.Namespace, parser: argparse.ArgumentParser):
|
||||||
parser.error("Please provide a model id")
|
parser.error("Please provide a model id")
|
||||||
return
|
return
|
||||||
|
|
||||||
prompt_guard = prompt_guard_model_sku()
|
# Check if model_id is a comma-separated list
|
||||||
if args.model_id == prompt_guard.model_id:
|
model_ids = [model_id.strip() for model_id in args.model_id.split(",")]
|
||||||
model = prompt_guard
|
|
||||||
info = prompt_guard_download_info()
|
|
||||||
else:
|
|
||||||
model = resolve_model(args.model_id)
|
|
||||||
if model is None:
|
|
||||||
parser.error(f"Model {args.model_id} not found")
|
|
||||||
return
|
|
||||||
info = llama_meta_net_info(model)
|
|
||||||
|
|
||||||
if args.source == "huggingface":
|
prompt_guard = prompt_guard_model_sku()
|
||||||
_hf_download(model, args.hf_token, args.ignore_patterns, parser)
|
for model_id in model_ids:
|
||||||
else:
|
if model_id == prompt_guard.model_id:
|
||||||
meta_url = args.meta_url
|
model = prompt_guard
|
||||||
if not meta_url:
|
info = prompt_guard_download_info()
|
||||||
meta_url = input(
|
else:
|
||||||
"Please provide the signed URL you received via email after visiting https://www.llama.com/llama-downloads/ (e.g., https://llama3-1.llamameta.net/*?Policy...): "
|
model = resolve_model(model_id)
|
||||||
|
if model is None:
|
||||||
|
parser.error(f"Model {model_id} not found")
|
||||||
|
continue
|
||||||
|
info = llama_meta_net_info(model)
|
||||||
|
|
||||||
|
if args.source == "huggingface":
|
||||||
|
_hf_download(model, args.hf_token, args.ignore_patterns, parser)
|
||||||
|
else:
|
||||||
|
meta_url = args.meta_url or input(
|
||||||
|
f"Please provide the signed URL for model {model_id} you received via email after visiting https://www.llama.com/llama-downloads/ (e.g., https://llama3-1.llamameta.net/*?Policy...): "
|
||||||
)
|
)
|
||||||
assert meta_url is not None and "llamameta.net" in meta_url
|
assert "llamameta.net" in meta_url
|
||||||
_meta_download(model, meta_url, info)
|
_meta_download(model, meta_url, info)
|
||||||
|
|
||||||
|
|
||||||
class ModelEntry(BaseModel):
|
class ModelEntry(BaseModel):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue