mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
add support for precompiled binaries, used as a fallback
This commit is contained in:
parent
9483288e03
commit
469d70be45
5 changed files with 125 additions and 14 deletions
|
@ -76,13 +76,20 @@ def file_exists(filename):
|
|||
return os.path.exists(os.path.join(getdirpath(), filename))
|
||||
|
||||
def pick_existant_file(ntoption,nonntoption):
|
||||
precompiled_prefix = "precompiled_"
|
||||
ntexist = file_exists(ntoption)
|
||||
nonntexist = file_exists(nonntoption)
|
||||
precompiled_ntexist = file_exists(precompiled_prefix+ntoption)
|
||||
precompiled_nonntexist = file_exists(precompiled_prefix+nonntoption)
|
||||
if os.name == 'nt':
|
||||
if not ntexist and precompiled_ntexist:
|
||||
return (precompiled_prefix+ntoption)
|
||||
if nonntexist and not ntexist:
|
||||
return nonntoption
|
||||
return ntoption
|
||||
else:
|
||||
if not nonntexist and precompiled_nonntexist:
|
||||
return (precompiled_prefix+nonntoption)
|
||||
if ntexist and not nonntexist:
|
||||
return ntoption
|
||||
return nonntoption
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue