ColeGuion commited on
Commit
21b62df
1 Parent(s): 90fd9d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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(text):
45
- return text
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(value="we shood buy an car")
60
- samp2 = gr.Button(value="she is more taller")
61
- samp3 = gr.Button(value="John and i saw a sheep over their.")
62
 
63
- samp1.click(update_prompt, samp1.value, prompt_box)
64
- samp2.click(update_prompt, samp2.value, prompt_box)
65
- samp3.click(update_prompt, samp3.value, prompt_box)
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):