ultimaxxl commited on
Commit
7c276e8
·
1 Parent(s): 0c6a371

Replace Dataset by Examples

Browse files

To populate correctly the inputs by user interaction with the example
table

Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,6 +6,8 @@ import requests
6
  import gradio as gr
7
  from PIL import Image
8
 
 
 
9
  # Read Baseten configuration from environment variables.
10
  BTEN_API_KEY = os.getenv("API_KEY")
11
  URL = os.getenv("URL")
@@ -239,12 +241,11 @@ with gr.Blocks(title="🌍 ZenCtrl") as demo:
239
  )
240
 
241
  # ---------------- Templates --------------------
242
- gr.Dataset(
 
 
243
  label="Presets (Input / Prompt / Output)",
244
- headers=["Input", "Prompt", "Output"],
245
- components=[input_image, prompt_box, output_image],
246
- samples=MODE_EXAMPLES.get(mode, []),
247
- samples_per_page=6,
248
  )
249
 
250
  if __name__ == "__main__":
 
6
  import gradio as gr
7
  from PIL import Image
8
 
9
+ import examples_db
10
+
11
  # Read Baseten configuration from environment variables.
12
  BTEN_API_KEY = os.getenv("API_KEY")
13
  URL = os.getenv("URL")
 
241
  )
242
 
243
  # ---------------- Templates --------------------
244
+ gr.Examples(
245
+ examples=examples_db.MODE_EXAMPLES.get(mode, []),
246
+ inputs=[input_image, prompt_box, output_image],
247
  label="Presets (Input / Prompt / Output)",
248
+ examples_per_page=6,
 
 
 
249
  )
250
 
251
  if __name__ == "__main__":