Improve PNNX assets check robustness (#10089)

This commit is contained in:
Glenn Jocher 2024-04-16 16:19:31 -07:00 committed by GitHub
parent c842825595
commit 03badaff57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -530,8 +530,9 @@ class Exporter:
)
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")
url = [x for x in assets if f"{system}.zip" in x][0]
assert url, "Unable to retrieve PNNX repo assets"
except Exception as e:
url = f"https://github.com/pnnx/pnnx/releases/download/20240410/pnnx-20240410-{system}.zip"
LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, using default {url}")