mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-07 00:41:50 +00:00
fix aria2c
This commit is contained in:
parent
f9ce2a00f0
commit
89feffc0e4
1 changed files with 8 additions and 2 deletions
10
koboldcpp.py
10
koboldcpp.py
|
|
@ -6507,9 +6507,12 @@ def downloader_internal(input_url, output_filename, capture_output, min_file_siz
|
|||
basepath = os.path.abspath(os.path.dirname(__file__))
|
||||
a2cexe = (os.path.join(basepath, "aria2c-win.exe"))
|
||||
if os.path.exists(a2cexe): #on windows try using embedded a2cexe
|
||||
out_dir = os.path.dirname(output_filename)
|
||||
out_name = os.path.basename(output_filename)
|
||||
rc = subprocess.run([
|
||||
a2cexe, "-x", "16", "-s", "16", "--summary-interval=15", "--console-log-level=error", "--log-level=error",
|
||||
"--download-result=default", "--continue=true", "--allow-overwrite=true", "--file-allocation=none", "--max-tries=3", "-o", output_filename, input_url
|
||||
"--download-result=default", "--continue=true", "--allow-overwrite=true", "--file-allocation=none", "--max-tries=3",
|
||||
"-d", out_dir, "-o", out_name, input_url
|
||||
], capture_output=capture_output, text=True, check=True, encoding='utf-8')
|
||||
dl_success = (rc.returncode == 0 and os.path.exists(output_filename) and os.path.getsize(output_filename) > min_file_size)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
@ -6517,9 +6520,12 @@ def downloader_internal(input_url, output_filename, capture_output, min_file_siz
|
|||
|
||||
try:
|
||||
if not dl_success and shutil.which("aria2c") is not None:
|
||||
out_dir = os.path.dirname(output_filename)
|
||||
out_name = os.path.basename(output_filename)
|
||||
rc = subprocess.run([
|
||||
"aria2c", "-x", "16", "-s", "16", "--summary-interval=15", "--console-log-level=error", "--log-level=error",
|
||||
"--download-result=default", "--allow-overwrite=true", "--file-allocation=none", "--max-tries=3", "-o", output_filename, input_url
|
||||
"--download-result=default", "--allow-overwrite=true", "--file-allocation=none", "--max-tries=3",
|
||||
"-d", out_dir, "-o", out_name, input_url
|
||||
], capture_output=capture_output, text=True, check=True, encoding='utf-8')
|
||||
dl_success = (rc.returncode == 0 and os.path.exists(output_filename) and os.path.getsize(output_filename) > min_file_size)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue