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"].values.tolist()
|
15 |
return prompt_list
|
16 |
|
17 |
def get_params(request: gr.Request):
|
@@ -249,13 +249,13 @@ with gr.Blocks(css=css) as demo:
|
|
249 |
elem_id = "Examples"
|
250 |
)
|
251 |
'''
|
252 |
-
exps = gr.Dataset(components=gr.Textbox(visible=False),
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
exp_refresh = gr.Button(value="Click Refresh to get newly prompt examples")
|
257 |
exp_refresh.click(get_samples, None, exps)
|
258 |
-
|
259 |
text_button.click(generate_txt2img, inputs=[current_model, text_prompt, negative_prompt, image_style], outputs=image_output)
|
260 |
demo.load(get_params, None, [current_model, exps])
|
261 |
|
|
|
11 |
prompt_df = dataset["train"].to_pandas()
|
12 |
|
13 |
def get_samples():
|
14 |
+
prompt_list = prompt_df.sample(n = 10)["Prompt"].map(lambda x: [x]).values.tolist()
|
15 |
return prompt_list
|
16 |
|
17 |
def get_params(request: gr.Request):
|
|
|
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 |
+
|
259 |
text_button.click(generate_txt2img, inputs=[current_model, text_prompt, negative_prompt, image_style], outputs=image_output)
|
260 |
demo.load(get_params, None, [current_model, exps])
|
261 |
|