mbar0075 commited on
Commit
37d183b
·
1 Parent(s): 7354412

Fixed problem

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -190,12 +190,9 @@ article = (
190
  example_folder = "examples" # Single folder for all examples
191
  examples = [[f"{example_folder}/{example}"] for example in os.listdir(example_folder) if example.endswith((".png", ".jpg", ".jpeg"))]
192
 
193
- # Only append the model internally, without showing it in the UI
194
- def add_model_to_example(example):
195
- return example + [default_model] # Adds model name internally
196
-
197
- # Apply the function to append the model to each example
198
- examples_with_model = [add_model_to_example(example) for example in examples]
199
 
200
  # Create the Gradio demo
201
  demo = gr.Interface(
@@ -204,7 +201,7 @@ demo = gr.Interface(
204
  gr.Image(type="pil", label="Upload an image"),
205
  gr.Dropdown(
206
  choices=list(models.keys()),
207
- value="Model v2",
208
  label="Select Model",
209
  interactive=True
210
  )
 
190
  example_folder = "examples" # Single folder for all examples
191
  examples = [[f"{example_folder}/{example}"] for example in os.listdir(example_folder) if example.endswith((".png", ".jpg", ".jpeg"))]
192
 
193
+ # For the list of examples, add the model name
194
+ for example in examples:
195
+ example.append(default_model)
 
 
 
196
 
197
  # Create the Gradio demo
198
  demo = gr.Interface(
 
201
  gr.Image(type="pil", label="Upload an image"),
202
  gr.Dropdown(
203
  choices=list(models.keys()),
204
+ value=default_model,
205
  label="Select Model",
206
  interactive=True
207
  )