Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
)
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|