From 89feffc0e49c13eaf44e7984cabd8007a32f1302 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:45:14 +0800 Subject: [PATCH] fix aria2c --- koboldcpp.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/koboldcpp.py b/koboldcpp.py index 941efd013..80f4fae88 100644 --- a/koboldcpp.py +++ b/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: