Spaces:
Runtime error
Runtime error
Commit ·
3eb0d5e
1
Parent(s): e9775e0
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,11 @@ def predict(text=None) -> dict:
|
|
| 27 |
print(top_5_tokens)
|
| 28 |
return {tokenizer.decode([tok]): float(score) for tok, score in zip(top_5_tokens, top_5_score)}
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
inputs=gr.inputs.Textbox(lines=2, placeholder="Your Text… "),
|
| 32 |
title="Mask Language Modeling - Demo",
|
| 33 |
outputs=gr.outputs.Label(num_top_classes=NUM_CLASSES)).launch()
|
|
|
|
| 27 |
print(top_5_tokens)
|
| 28 |
return {tokenizer.decode([tok]): float(score) for tok, score in zip(top_5_tokens, top_5_score)}
|
| 29 |
|
| 30 |
+
|
| 31 |
+
def test():
|
| 32 |
+
return {"token": 0.57}
|
| 33 |
+
|
| 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=NUM_CLASSES)).launch()
|