FahadAlam commited on
Commit
5552924
·
1 Parent(s): 17df930

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- unmasker = pipeline('fill-mask', model='xlm-roberta-base')
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 <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()
 
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()