Spaces:
Sleeping
Sleeping
Commit ·
e2d4d22
1
Parent(s): 643bcb6
init
Browse files
app.py
CHANGED
|
@@ -1,27 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
iface = gr.Interface(
|
| 13 |
-
fn=mask_filler,
|
| 14 |
-
inputs=gr.Textbox(lines=3, label="Enter a sentence with [MASK] token"),
|
| 15 |
-
outputs=gr.Textbox(label="Completed sentence"),
|
| 16 |
-
title="SteelBERT Mask Filler",
|
| 17 |
-
description="Fill in the masked token using SteelBERT.",
|
| 18 |
)
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
["SteelBERT is a [MASK] model for filling in missing information."],
|
| 23 |
-
["I have a [MASK] of apples and oranges."],
|
| 24 |
-
]
|
| 25 |
-
|
| 26 |
-
iface.examples = examples
|
| 27 |
-
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
+
def greet(name, intensity):
|
| 4 |
+
return "Hello, " + name + "!" * intensity
|
| 5 |
|
| 6 |
+
demo = gr.Interface(
|
| 7 |
+
fn=greet,
|
| 8 |
+
inputs=["text", gr.Slider(value=2, minimum=1, maximum=10, step=1)],
|
| 9 |
+
outputs=[gr.Textbox(label="greeting", lines=3)],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
)
|
| 11 |
|
| 12 |
+
if __name__ == "__main__":
|
| 13 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|