Tonic commited on
Commit
876232e
β€’
1 Parent(s): 0bc1500

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -22,15 +22,15 @@ def generate_text(prompt, max_new_tokens, top_k, top_p, do_sample):
22
  def main():
23
  with gr.Blocks() as demo:
24
  gr.Markdown(title)
25
- output = gr.Textbox(label="Generated Text", lines=10)
26
- submit_button = gr.Button("Generate")
27
- with gr.Accordion("Optional Parameters"):
28
- max_new_tokens = gr.Slider(minimum=1, maximum=650, step=1, value=300, label="new tokens in reply")
29
- top_k = gr.Slider(minimum=1, maximum=100, step=1, value=50, label="Top K")
30
- top_p = gr.Slider(minimum=0.1, maximum=1.0, step=0.01, value=0.95, label="Top P")
31
- do_sample = gr.Checkbox(value=True, label="Untick for faster inference")
32
  prompt = gr.Textbox(label="Enter your prompt")
33
- prompt.change(fn=generate_text, inputs=[prompt, max_new_tokens, top_k, top_p, do_sample], outputs=output, submit=submit_button)
34
 
35
  demo.launch()
36
 
 
22
  def main():
23
  with gr.Blocks() as demo:
24
  gr.Markdown(title)
25
+ output = gr.Textbox(label="πŸ‘΄πŸ»πŸ‘OLMo", lines=10)
26
+ submit_button = gr.Button("🌟Try it Out!")
27
+ with gr.Accordion("πŸ€–Optional Parameters"):
28
+ max_new_tokens = gr.Slider(minimum=1, maximum=650, step=1, value=300, label="πŸͺ™new tokens in reply")
29
+ top_k = gr.Slider(minimum=1, maximum=100, step=1, value=50, label="πŸ—£οΈTop K")
30
+ top_p = gr.Slider(minimum=0.1, maximum=1.0, step=0.01, value=0.95, label="🀫Repetition Penalty")
31
+ do_sample = gr.Checkbox(value=False, label="Untick for faster inference")
32
  prompt = gr.Textbox(label="Enter your prompt")
33
+ submit_button.click(fn=generate_text, inputs=[prompt, max_new_tokens, top_k, top_p, do_sample], outputs=output)
34
 
35
  demo.launch()
36