Pin PNNX to avoid PNNX==20240410 bug (#9953)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-04-10 17:46:41 +02:00 committed by GitHub
parent 417c429ec4
commit ea03db9984
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View file

@ -529,12 +529,16 @@ 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)
url = [x for x in assets if f"{system}.zip" in x][0]
except Exception as e:
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}")
# PNNX link fixed at 20240226 due to bug in 20240410
# try:
# _, assets = get_github_assets(repo="pnnx/pnnx", retry=True)
# url = [x for x in assets if f"{system}.zip" in x][0]
# except Exception as e:
# 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}")
url = f"https://github.com/pnnx/pnnx/releases/download/20240226/pnnx-20240226-{system}.zip"
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("")