Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
unmasker = pipeline('fill-mask', model='
|
| 5 |
output = {}
|
| 6 |
|
| 7 |
def fill_mask(text):
|
|
@@ -10,7 +10,7 @@ def fill_mask(text):
|
|
| 10 |
output[unmask["token_str"]] = unmask["score"]
|
| 11 |
return output
|
| 12 |
|
| 13 |
-
examples = [["Hello I'm a
|
| 14 |
|
| 15 |
demo = gr.Interface(fn=fill_mask, inputs="text", outputs="label", title="Fill Mask", examples=examples)
|
| 16 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
unmasker = pipeline('fill-mask', model='bert-base-uncased')
|
| 5 |
output = {}
|
| 6 |
|
| 7 |
def fill_mask(text):
|
|
|
|
| 10 |
output[unmask["token_str"]] = unmask["score"]
|
| 11 |
return output
|
| 12 |
|
| 13 |
+
examples = [["Hello I'm a [MASK] model."], ["[MASK] is my favourite sports."]]
|
| 14 |
|
| 15 |
demo = gr.Interface(fn=fill_mask, inputs="text", outputs="label", title="Fill Mask", examples=examples)
|
| 16 |
demo.launch()
|