artificialguybr commited on
Commit
987176f
1 Parent(s): 5fd289b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -23,6 +23,7 @@ def query(payload, api_url, token):
23
  # Define the function to run when the button is clicked
24
  def run_lora(prompt, selected_lora_index):
25
  if selected_lora_index is not None:
 
26
  selected_lora = loras[selected_lora_index]
27
  api_url = f"https://api-inference.huggingface.co/models/{selected_lora['repo']}"
28
  trigger_word = selected_lora["trigger_word"]
@@ -36,9 +37,8 @@ def run_lora(prompt, selected_lora_index):
36
  return Image.open(image_bytes)
37
  return "API Error or No LoRA selected"
38
 
39
-
40
  # Placeholder for gallery.select function
41
- def update_selection(selected):
42
  if selected is None:
43
  return None,
44
  return selected[0],
 
23
  # Define the function to run when the button is clicked
24
  def run_lora(prompt, selected_lora_index):
25
  if selected_lora_index is not None:
26
+ selected_lora_index = selected_lora_index[0] # Unpack the tuple
27
  selected_lora = loras[selected_lora_index]
28
  api_url = f"https://api-inference.huggingface.co/models/{selected_lora['repo']}"
29
  trigger_word = selected_lora["trigger_word"]
 
37
  return Image.open(image_bytes)
38
  return "API Error or No LoRA selected"
39
 
 
40
  # Placeholder for gallery.select function
41
+ def update_selection(selected=None):
42
  if selected is None:
43
  return None,
44
  return selected[0],