Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ dataset = load_dataset("Gustavosta/Stable-Diffusion-Prompts")
|
|
11 |
prompt_df = dataset["train"].to_pandas()
|
12 |
|
13 |
def get_samples():
|
14 |
-
prompt_list = prompt_df.sample(n = 10)["Prompt"].
|
15 |
return prompt_list
|
16 |
|
17 |
def get_params(request: gr.Request):
|
@@ -241,12 +241,18 @@ with gr.Blocks(css=css) as demo:
|
|
241 |
|
242 |
with gr.Row():
|
243 |
with gr.Column():
|
|
|
244 |
exps = gr.Examples(
|
245 |
get_samples(),
|
246 |
inputs = text_prompt,
|
247 |
label = "Prompt Examples",
|
248 |
elem_id = "Examples"
|
249 |
)
|
|
|
|
|
|
|
|
|
|
|
250 |
exp_refresh = gr.Button(value="Click Refresh to get newly prompt examples")
|
251 |
exp_refresh.click(get_samples, None, exps)
|
252 |
|
|
|
11 |
prompt_df = dataset["train"].to_pandas()
|
12 |
|
13 |
def get_samples():
|
14 |
+
prompt_list = prompt_df.sample(n = 10)["Prompt"].values.tolist()
|
15 |
return prompt_list
|
16 |
|
17 |
def get_params(request: gr.Request):
|
|
|
241 |
|
242 |
with gr.Row():
|
243 |
with gr.Column():
|
244 |
+
'''
|
245 |
exps = gr.Examples(
|
246 |
get_samples(),
|
247 |
inputs = text_prompt,
|
248 |
label = "Prompt Examples",
|
249 |
elem_id = "Examples"
|
250 |
)
|
251 |
+
'''
|
252 |
+
exps = gr.Dataset(components=[gr.Textbox(visible=False)],
|
253 |
+
label="Prompt Examples",
|
254 |
+
samples=get_samples(),
|
255 |
+
)
|
256 |
exp_refresh = gr.Button(value="Click Refresh to get newly prompt examples")
|
257 |
exp_refresh.click(get_samples, None, exps)
|
258 |
|