Fix NCNN multiple-volumes PNNX download bug (#14533)

pull/14474/head^2
Ariel Kukulanski 8 months ago committed by GitHub
parent f50274c596
commit 0822710185
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/engine/exporter.py

@ -563,7 +563,7 @@ class Exporter:
LOGGER.warning(f"{prefix} WARNING ⚠ PNNX GitHub assets not found: {e}, using default {asset}")
unzip_dir = safe_download(f"https://github.com/pnnx/pnnx/releases/download/{release}/{asset}", delete=True)
if check_is_path_safe(Path.cwd(), unzip_dir): # avoid path traversal security vulnerability
(unzip_dir / name).rename(pnnx) # move binary to ROOT
shutil.move(src=unzip_dir / name, dst=pnnx) # move binary to ROOT
pnnx.chmod(0o777) # set read, write, and execute permissions for everyone
shutil.rmtree(unzip_dir) # delete unzip dir

Loading…
Cancel
Save