mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 13:34:23 +08:00
Fix PNNX ubuntu
-> linux
bug (#7050)
This commit is contained in:
parent
28593dfb1c
commit
e9def85f1f
@ -459,11 +459,14 @@ class Exporter:
|
||||
f'{prefix} WARNING ⚠️ PNNX not found. Attempting to download binary file from '
|
||||
'https://github.com/pnnx/pnnx/.\nNote PNNX Binary file must be placed in current working directory '
|
||||
f'or in {ROOT}. See PNNX repo for full installation instructions.')
|
||||
_, assets = get_github_assets(repo='pnnx/pnnx', retry=True)
|
||||
system = 'macos' if MACOS else 'ubuntu' if LINUX else 'windows' # operating system
|
||||
asset = [x for x in assets if system in x][0] if assets else \
|
||||
f'https://github.com/pnnx/pnnx/releases/download/20230816/pnnx-20230816-{system}.zip' # fallback
|
||||
asset = attempt_download_asset(asset, repo='pnnx/pnnx', release='latest')
|
||||
system = ['macos'] if MACOS else ['windows'] if WINDOWS else ['ubuntu', 'linux'] # operating system
|
||||
try:
|
||||
_, assets = get_github_assets(repo='pnnx/pnnx', retry=True)
|
||||
url = [x for x in assets if any(s in x for s in system)][0]
|
||||
except Exception as e:
|
||||
url = f'https://github.com/pnnx/pnnx/releases/download/20231127/pnnx-20231127-{system[0]}.zip'
|
||||
LOGGER.warning(f'{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, 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('')
|
||||
(unzip_dir / name).rename(pnnx) # move binary to ROOT
|
||||
|
Loading…
x
Reference in New Issue
Block a user