Update app.py
Browse files
app.py
CHANGED
|
@@ -94,16 +94,18 @@ def download_file(url, directory=None):
|
|
| 94 |
return filepath
|
| 95 |
|
| 96 |
def get_trigger_word(base_model, lora_models):
|
| 97 |
-
|
| 98 |
-
trigger_word = "<span style='color:green;'>default_trigger</span>" # Set default trigger word with green color
|
| 99 |
if "lora1" in lora_models:
|
| 100 |
-
|
| 101 |
if "lora2" in lora_models:
|
| 102 |
-
|
| 103 |
if "lora3" in lora_models:
|
| 104 |
-
|
| 105 |
if "lora4" in lora_models:
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
| 107 |
return trigger_word
|
| 108 |
|
| 109 |
def update_selection(evt: gr.SelectData, selected_indices, loras_state, width, height):
|
|
|
|
| 94 |
return filepath
|
| 95 |
|
| 96 |
def get_trigger_word(base_model, lora_models):
|
| 97 |
+
trigger_words = [] # Initialize an empty list to hold trigger words
|
|
|
|
| 98 |
if "lora1" in lora_models:
|
| 99 |
+
trigger_words.append(lora1.get('trigger_word', ''))
|
| 100 |
if "lora2" in lora_models:
|
| 101 |
+
trigger_words.append(lora2.get('trigger_word', ''))
|
| 102 |
if "lora3" in lora_models:
|
| 103 |
+
trigger_words.append(lora3.get('trigger_word', ''))
|
| 104 |
if "lora4" in lora_models:
|
| 105 |
+
trigger_words.append(lora4.get('trigger_word', ''))
|
| 106 |
+
|
| 107 |
+
# Join all trigger words with a space and wrap in a span
|
| 108 |
+
trigger_word = "<span style='color:green;'> " + " ".join(trigger_words) + " </span>"
|
| 109 |
return trigger_word
|
| 110 |
|
| 111 |
def update_selection(evt: gr.SelectData, selected_indices, loras_state, width, height):
|