Update app.py
Browse files
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="
|
| 26 |
-
submit_button = gr.Button("
|
| 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="
|
| 31 |
-
do_sample = gr.Checkbox(value=
|
| 32 |
prompt = gr.Textbox(label="Enter your prompt")
|
| 33 |
-
|
| 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 |
|