Fixed path bug? Might be because of gradio update

pull/3/head
antis0007 2023-04-07 12:47:44 -06:00
parent 5a5ff86c31
commit 4dbea1df32
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,12 @@ def on_ui_settings():
def fetch(image):
#update hash based on image
name = image.orig_name
#image.orig_name returns the path of the image, so we need to get the name of the file from that path
#make this work for windows and linux
if "\\" in name:
name = name.split("\\")[-1]
elif "/" in name:
name = name.split("/")[-1]
print("name: " + name)
hash = name.split(".")[0]
if hash.startswith("sample_"):