mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 05:24:22 +08:00
More robust PNNX downloads (#8866)
This commit is contained in:
parent
617ab21523
commit
d24ead447e
@ -528,12 +528,12 @@ class Exporter:
|
||||
f"or in {ROOT}. See PNNX repo for full installation instructions."
|
||||
)
|
||||
system = "macos" if MACOS else "windows" if WINDOWS else "linux-aarch64" if ARM64 else "linux"
|
||||
try:
|
||||
_, assets = get_github_assets(repo="pnnx/pnnx", retry=True)
|
||||
_, assets = get_github_assets(repo="pnnx/pnnx", retry=True)
|
||||
if assets:
|
||||
url = [x for x in assets if f"{system}.zip" in x][0]
|
||||
except Exception as e:
|
||||
else:
|
||||
url = f"https://github.com/pnnx/pnnx/releases/download/20240226/pnnx-20240226-{system}.zip"
|
||||
LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, using default {url}")
|
||||
LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found, using default {url}")
|
||||
asset = attempt_download_asset(url, repo="pnnx/pnnx", release="latest")
|
||||
if check_is_path_safe(Path.cwd(), asset): # avoid path traversal security vulnerability
|
||||
unzip_dir = Path(asset).with_suffix("")
|
||||
|
Loading…
x
Reference in New Issue
Block a user