artificialguybr
commited on
Commit
·
49f145b
1
Parent(s):
a146eda
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ with open('loras.json', 'r') as f:
|
|
13 |
|
14 |
def update_selection(selected_state: gr.SelectData):
|
15 |
logging.debug(f"Inside update_selection, selected_state: {selected_state}")
|
16 |
-
selected_lora_index = selected_state
|
17 |
selected_lora = loras[selected_lora_index]
|
18 |
new_placeholder = f"Type a prompt for {selected_lora['title']}"
|
19 |
return (
|
@@ -27,7 +27,7 @@ def run_lora(prompt, selected_state, progress=gr.Progress(track_tqdm=True)):
|
|
27 |
logging.error("selected_state is None or empty.")
|
28 |
raise gr.Error("You must select a LoRA")
|
29 |
|
30 |
-
selected_lora_index = selected_state
|
31 |
selected_lora = loras[selected_lora_index]
|
32 |
api_url = f"https://api-inference.huggingface.co/models/{selected_lora['repo']}"
|
33 |
trigger_word = selected_lora["trigger_word"]
|
|
|
13 |
|
14 |
def update_selection(selected_state: gr.SelectData):
|
15 |
logging.debug(f"Inside update_selection, selected_state: {selected_state}")
|
16 |
+
selected_lora_index = selected_state.index # Changed this line
|
17 |
selected_lora = loras[selected_lora_index]
|
18 |
new_placeholder = f"Type a prompt for {selected_lora['title']}"
|
19 |
return (
|
|
|
27 |
logging.error("selected_state is None or empty.")
|
28 |
raise gr.Error("You must select a LoRA")
|
29 |
|
30 |
+
selected_lora_index = selected_state.index # Changed this line
|
31 |
selected_lora = loras[selected_lora_index]
|
32 |
api_url = f"https://api-inference.huggingface.co/models/{selected_lora['repo']}"
|
33 |
trigger_word = selected_lora["trigger_word"]
|