Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,23 @@ def text2text(input_text):
|
|
25 |
outputs = model.generate(input_ids, max_length=40)
|
26 |
return tokenizer.decode(outputs[0])
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
outputs = model.generate(input_ids, max_length=40)
|
26 |
return tokenizer.decode(outputs[0])
|
27 |
|
28 |
+
|
29 |
+
with gr.Blocks() as demo:
|
30 |
+
|
31 |
+
txt_in = gr.Textbox(label="Input", lines=2)
|
32 |
+
txt_out = gr.Textbox(value="", label="Output")
|
33 |
+
|
34 |
+
|
35 |
+
btn = gr.Button(value="Submit")
|
36 |
+
btn.click(text2text, inputs=[text_in], outputs=[txt_out])
|
37 |
+
|
38 |
+
|
39 |
+
gr.Examples(
|
40 |
+
examples=get_examples(),
|
41 |
+
inputs=[txt_in],
|
42 |
+
cache_examples=True
|
43 |
+
)
|
44 |
+
|
45 |
+
|
46 |
+
if __name__ == "__main__":
|
47 |
+
demo.launch()
|