Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,8 +41,8 @@ def respond(prompt, max_length, min_length, max_new_tokens, num_beams, temperatu
|
|
41 |
#response = correct_text(prompt, max_length, max_new_tokens, min_length, num_beams, temperature, top_p)
|
42 |
return prompt
|
43 |
|
44 |
-
def update_prompt(
|
45 |
-
return
|
46 |
|
47 |
# Create the Gradio interface
|
48 |
with gr.Blocks() as demo:
|
@@ -56,13 +56,13 @@ with gr.Blocks() as demo:
|
|
56 |
|
57 |
# Sample prompts
|
58 |
with gr.Row():
|
59 |
-
samp1 = gr.Button(
|
60 |
-
samp2 = gr.Button(
|
61 |
-
samp3 = gr.Button(
|
62 |
|
63 |
-
samp1.click(update_prompt, samp1
|
64 |
-
samp2.click(update_prompt, samp2
|
65 |
-
samp3.click(update_prompt, samp3
|
66 |
|
67 |
|
68 |
with gr.Accordion("Generation Parameters:", open=False):
|
|
|
41 |
#response = correct_text(prompt, max_length, max_new_tokens, min_length, num_beams, temperature, top_p)
|
42 |
return prompt
|
43 |
|
44 |
+
def update_prompt(promptBtn):
|
45 |
+
return promptBtn.value
|
46 |
|
47 |
# Create the Gradio interface
|
48 |
with gr.Blocks() as demo:
|
|
|
56 |
|
57 |
# Sample prompts
|
58 |
with gr.Row():
|
59 |
+
samp1 = gr.Button("we shood buy an car")
|
60 |
+
samp2 = gr.Button("she is more taller")
|
61 |
+
samp3 = gr.Button("John and i saw a sheep over their.")
|
62 |
|
63 |
+
samp1.click(update_prompt, samp1, prompt_box)
|
64 |
+
samp2.click(update_prompt, samp2, prompt_box)
|
65 |
+
samp3.click(update_prompt, samp3, prompt_box)
|
66 |
|
67 |
|
68 |
with gr.Accordion("Generation Parameters:", open=False):
|