Michael Ramos commited on
Commit
c0a6675
1 Parent(s): 3139757

make sure there is a prompt

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -85,6 +85,9 @@ assert len(images) == 34, "There should be exactly 34 images in the 'images' fol
85
  async def select_fn(data: gr.SelectData, prompt: str):
86
  global selected_image_index
87
  selected_image_index = data.index
 
 
 
88
  return await predict(prompt)
89
 
90
  async def predict(prompt):
 
85
  async def select_fn(data: gr.SelectData, prompt: str):
86
  global selected_image_index
87
  selected_image_index = data.index
88
+ if prompt == "":
89
+ print("Prompt is empty, returning original image")
90
+ return images[selected_image_index]
91
  return await predict(prompt)
92
 
93
  async def predict(prompt):