Skip to content

Commit

Permalink
if no existing filepath, do not use cwd, use last path instead
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Mar 11, 2024
1 parent 4dd1c2b commit 9229ea6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion klite.embd
Original file line number Diff line number Diff line change
Expand Up @@ -10521,7 +10521,7 @@ Current version: 123
gametext_arr.push(nimgtag);
image_db[data.id] = { done: false, queue: "Starting", result: "", prompt:sentence, local:false };
image_db[data.id].aspect = (iwidth>iheight?2:(iwidth<iheight?1:0));
image_db[imgid].imsource = 0; //0=generated,1=uploaded
image_db[data.id].imsource = 0; //0=generated,1=uploaded
console.log("New image queued " + nimgtag);
}
else {
Expand Down
6 changes: 3 additions & 3 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,8 +1573,8 @@ def makelabelentry(parent, text, var, row=0, width= 50,tooltip=""):
def makefileentry(parent, text, searchtext, var, row=0, width=200, filetypes=[], onchoosefile=None, singlerow=False, tooltiptxt=""):
makelabel(parent, text, row,0,tooltiptxt)
def getfilename(var, text):
initialDir = os.path.dirname(var.get())
initialDir = initialDir if os.path.isdir(initialDir) else os.getcwd()
initialDir = os.path.dirname(var.get())
initialDir = initialDir if os.path.isdir(initialDir) else None
fnam = askopenfilename(title=text,filetypes=filetypes, initialdir=initialDir)
if fnam:
var.set(fnam)
Expand Down Expand Up @@ -2232,7 +2232,7 @@ def load_config():
file_type = [("KoboldCpp Settings", "*.kcpps")]
global runmode_untouched
runmode_untouched = False
filename = askopenfilename(filetypes=file_type, defaultextension=file_type, initialdir=os.getcwd())
filename = askopenfilename(filetypes=file_type, defaultextension=file_type, initialdir=None)
if not filename or filename=="":
return
with open(filename, 'r') as f:
Expand Down

0 comments on commit 9229ea6

Please sign in to comment.