Skip to content

Commit

Permalink
fixed horde worker flag
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed May 10, 2024
1 parent 7967377 commit 1effe16
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3009,13 +3009,16 @@ def main(launch_args,start_server=True):
friendlymodelname = "debug-" + friendlymodelname
if not friendlymodelname.startswith("koboldcpp/"):
friendlymodelname = "koboldcpp/" + friendlymodelname
if args.hordegenlen and args.hordegenlen > 0:
maxhordelen = int(args.hordegenlen)
if args.hordemaxctx and args.hordemaxctx > 0:
maxhordectx = int(args.hordemaxctx)

if (args.hordemodelname and args.hordemodelname!="") or (args.hordeworkername and args.hordeworkername!="") or (args.hordekey and args.hordekey!=""):
if args.debugmode == 0:
args.debugmode = -1

if args.hordegenlen and args.hordegenlen > 0:
maxhordelen = int(args.hordegenlen)
if args.hordemaxctx and args.hordemaxctx > 0:
maxhordectx = int(args.hordemaxctx)

if args.debugmode != 1:
showdebug = False

Expand Down Expand Up @@ -3215,10 +3218,13 @@ def main(launch_args,start_server=True):
except:
print("--launch was set, but could not launch web browser automatically.")

if args.hordekey and args.hordekey!="" and args.hordemodelname and args.hordemodelname!="" and args.hordeworkername and args.hordeworkername!="":
horde_thread = threading.Thread(target=run_horde_worker,args=(args,args.hordekey,args.hordeworkername))
horde_thread.daemon = True
horde_thread.start()
if args.hordekey and args.hordekey!="":
if args.hordeworkername and args.hordeworkername!="":
horde_thread = threading.Thread(target=run_horde_worker,args=(args,args.hordekey,args.hordeworkername))
horde_thread.daemon = True
horde_thread.start()
else:
print("Horde worker could not start. You need to specify a horde worker name with --hordeworkername")

#if post-ready script specified, execute it
if args.onready:
Expand Down

0 comments on commit 1effe16

Please sign in to comment.