Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ model = T5ForConditionalGeneration.from_pretrained("roborovski/superprompt-v1",
|
|
14 |
|
15 |
|
16 |
def generate(
|
17 |
-
prompt, history, max_new_tokens=512, repetition_penalty=1.2, temperature=0.5, top_p=1, top_k=1
|
18 |
):
|
19 |
|
20 |
input_text = f"{prompt}, {history}"
|
@@ -29,6 +29,7 @@ additional_inputs=[
|
|
29 |
gr.Slider(value=0.5, minimum=0, maximum=1, step=0.05, interactive=True, label="Temperature", info="Higher values produce more diverse outputs"),
|
30 |
gr.Slider(value=1, minimum=0, maximum=2, step=0.05, interactive=True, label="Top P", info="Higher values sample more low-probability tokens"),
|
31 |
gr.Slider(value=1, minimum=1, maximum=100, step=1, interactive=True, label="Top K", info="Higher k means more diverse outputs by considering a range of tokens"),
|
|
|
32 |
]
|
33 |
|
34 |
examples=[["Expand the following prompt to add more detail: A storefront with 'Text to Image' written on it.", None, None ]]
|
|
|
14 |
|
15 |
|
16 |
def generate(
|
17 |
+
prompt, history, max_new_tokens=512, repetition_penalty=1.2, temperature=0.5, top_p=1, top_k=1, seed=42
|
18 |
):
|
19 |
|
20 |
input_text = f"{prompt}, {history}"
|
|
|
29 |
gr.Slider(value=0.5, minimum=0, maximum=1, step=0.05, interactive=True, label="Temperature", info="Higher values produce more diverse outputs"),
|
30 |
gr.Slider(value=1, minimum=0, maximum=2, step=0.05, interactive=True, label="Top P", info="Higher values sample more low-probability tokens"),
|
31 |
gr.Slider(value=1, minimum=1, maximum=100, step=1, interactive=True, label="Top K", info="Higher k means more diverse outputs by considering a range of tokens"),
|
32 |
+
gr.Number(value=42, interactive=True, label="Seed", info="A starting point to initiate the generation process"),
|
33 |
]
|
34 |
|
35 |
examples=[["Expand the following prompt to add more detail: A storefront with 'Text to Image' written on it.", None, None ]]
|