Spaces:
Paused
Paused
Replace Dataset by Examples
Browse filesTo populate correctly the inputs by user interaction with the example
table
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.
|
|
|
|
|
|
|
| 243 |
label="Presets (Input / Prompt / Output)",
|
| 244 |
-
|
| 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__":
|