Spaces:
Runtime error
Runtime error
Commit
·
64ae95d
1
Parent(s):
3eb0d5e
Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,8 @@ device = torch.device('cpu')
|
|
7 |
|
8 |
NUM_CLASSES=6
|
9 |
|
10 |
-
model=BertForMaskedLM.from_pretrained("./")
|
11 |
-
tokenizer=BertTokenizer.from_pretrained("./")
|
12 |
|
13 |
|
14 |
def predict(text=None) -> dict:
|
@@ -34,4 +34,4 @@ def test():
|
|
34 |
gr.Interface(fn=test,
|
35 |
inputs=gr.inputs.Textbox(lines=2, placeholder="Your Text… "),
|
36 |
title="Mask Language Modeling - Demo",
|
37 |
-
outputs=gr.outputs.Label(num_top_classes=
|
|
|
7 |
|
8 |
NUM_CLASSES=6
|
9 |
|
10 |
+
#model=BertForMaskedLM.from_pretrained("./")
|
11 |
+
#tokenizer=BertTokenizer.from_pretrained("./")
|
12 |
|
13 |
|
14 |
def predict(text=None) -> dict:
|
|
|
34 |
gr.Interface(fn=test,
|
35 |
inputs=gr.inputs.Textbox(lines=2, placeholder="Your Text… "),
|
36 |
title="Mask Language Modeling - Demo",
|
37 |
+
outputs=gr.outputs.Label(num_top_classes=1)).launch()
|