marcelbinz commited on
Commit
186c6d4
·
verified ·
1 Parent(s): d42d707

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -14,11 +14,17 @@ pipe = pipeline(
14
  def infer(prompt):
15
  return pipe(prompt, max_new_tokens=1, do_sample=True, temperature=1.0)[0]["generated_text"]
16
 
17
- demo = gr.Interface(
18
- fn=infer,
19
- inputs=gr.Textbox(label="Prompt"),
20
- outputs="text",
21
- title="Minitaur",
22
- description="Just type and hit *Run*"
23
- ).queue()
24
- demo.launch()
 
 
 
 
 
 
 
14
  def infer(prompt):
15
  return pipe(prompt, max_new_tokens=1, do_sample=True, temperature=1.0)[0]["generated_text"]
16
 
17
+ with gr.Blocks(fill_width=True, css="""
18
+ #prompt-box textarea {height:200px}
19
+ #answer-box textarea {height:320px}
20
+ """) as demo:
21
+ with gr.Row(equal_height=True):
22
+ inp = gr.Textbox(label="Prompt", elem_id="prompt-box",
23
+ lines=6, max_lines=12, scale=3)
24
+ outp = gr.Textbox(label="Response", elem_id="answer-box",
25
+ lines=12, interactive=False, scale=3)
26
+
27
+ run = gr.Button("Run")
28
+ run.click(infer, inp, outp)
29
+
30
+ demo.queue().launch()