feat: add ability to load checkpoints and loras from multiple locations (#1256)

* Add ability to load checkpoints and loras from multiple locations

* Found another location a default path is required

* feat: use array as default

---------

Co-authored-by: Manuel Schmid <manuel.schmid@odt.net>
This commit is contained in:
dooglewoogle
2024-02-25 12:47:14 +01:00
committed by GitHub
co-authored by Manuel Schmid
parent 7cfb5e742d
commit ef1999c52c
5 changed files with 43 additions and 18 deletions
+9
View File
@@ -177,5 +177,14 @@ def get_files_from_folder(folder_path, exensions=None, name_filter=None):
return filenames
def get_file_from_folder_list(name, folders):
for folder in folders:
filename = os.path.abspath(os.path.realpath(os.path.join(folder, name)))
if os.path.isfile(filename):
return filename
return os.path.abspath(os.path.realpath(os.path.join(folders[0], name)))
def ordinal_suffix(number: int) -> str:
return 'th' if 10 <= number % 100 <= 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(number % 10, 'th')