Spaces:
Build error
Build error
danseith
commited on
Commit
·
b5b3297
1
Parent(s):
8c0b646
Added duplicate add_mask
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ unmasker = pipeline("fill-mask", model="anferico/bert-for-patents")
|
|
7 |
example = 'A crustless sandwich made from two slices of baked bread'
|
8 |
|
9 |
def unmask(text):
|
|
|
10 |
res = unmasker(text)
|
11 |
out = {item["token_str"]: item["score"] for item in res}
|
12 |
return out
|
@@ -16,6 +17,7 @@ textbox = gr.Textbox(label="Type language here", lines=5)
|
|
16 |
import gradio as gr
|
17 |
from transformers import pipeline
|
18 |
|
|
|
19 |
unmasker = pipeline("fill-mask", model="anferico/bert-for-patents")
|
20 |
|
21 |
|
|
|
7 |
example = 'A crustless sandwich made from two slices of baked bread'
|
8 |
|
9 |
def unmask(text):
|
10 |
+
text = add_mask(text)
|
11 |
res = unmasker(text)
|
12 |
out = {item["token_str"]: item["score"] for item in res}
|
13 |
return out
|
|
|
17 |
import gradio as gr
|
18 |
from transformers import pipeline
|
19 |
|
20 |
+
|
21 |
unmasker = pipeline("fill-mask", model="anferico/bert-for-patents")
|
22 |
|
23 |
|