Skip to content

Commit c8850b0

Browse files
committed
adding support for user presets
1 parent 5f6d021 commit c8850b0

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

lora_gui.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,14 +1010,23 @@ def lora_tab(
10101010

10111011
def list_presets(path):
10121012
json_files = []
1013+
10131014
for file in os.listdir(path):
10141015
if file.endswith('.json'):
10151016
json_files.append(os.path.splitext(file)[0])
1017+
1018+
user_presets_path = os.path.join(path, 'user_presets')
1019+
if os.path.isdir(user_presets_path):
1020+
for file in os.listdir(user_presets_path):
1021+
if file.endswith('.json'):
1022+
preset_name = os.path.splitext(file)[0]
1023+
json_files.append(os.path.join('user_presets', preset_name))
1024+
10161025
return json_files
10171026

10181027
training_preset = gr.Dropdown(
10191028
label='Presets',
1020-
choices=list_presets('./presets/lora'),
1029+
choices=list_presets('./presets/gui/lora'),
10211030
elem_id='myDropdown',
10221031
)
10231032
with gr.Row():

presets/finetune/user_presets/.put your own presets here

Whitespace-only changes.

presets/lora/user_presets/.put your own presets here

Whitespace-only changes.

0 commit comments

Comments
 (0)