Skip to content

Commit f9ce2a0

Browse files
committed
consistent file download locations
1 parent f0d4128 commit f9ce2a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

koboldcpp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6492,7 +6492,9 @@ def downloader_internal(input_url, output_filename, capture_output, min_file_siz
64926492
if "https://huggingface.co/" in input_url and "/blob/main/" in input_url:
64936493
input_url = input_url.replace("/blob/main/", "/resolve/main/")
64946494
if output_filename == "auto":
6495-
output_filename = os.path.basename(input_url).split('?')[0].split('#')[0]
6495+
exe_dir = os.path.dirname(sys.executable if getattr(sys, 'frozen', False) else __file__)
6496+
filename = os.path.basename(input_url).split('?')[0].split('#')[0]
6497+
output_filename = os.path.join(exe_dir, filename)
64966498
incomplete_dl_exist = (os.path.exists(output_filename+".aria2") and os.path.getsize(output_filename+".aria2") > 16)
64976499
if os.path.exists(output_filename) and os.path.getsize(output_filename) > min_file_size and not incomplete_dl_exist:
64986500
print(f"{output_filename} already exists, using existing file.")

0 commit comments

Comments
 (0)