Spaces:
Runtime error
Runtime error
zhangxiaochen commited on
fix typo
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ model=BertForSequenceClassification.from_pretrained('IDEA-CCNL/Erlangshen-Robert
|
|
| 9 |
def predict(input_text):
|
| 10 |
predictions = model(torch.tensor([tokenizer.encode(input_text)]))
|
| 11 |
predictions=torch.nn.functional.softmax(predictions.logits,dim=-1)
|
|
|
|
| 12 |
return input_text, {p["label"]: p["score"] for p in predictions}
|
| 13 |
|
| 14 |
gradio_app = gr.Interface(
|
|
|
|
| 9 |
def predict(input_text):
|
| 10 |
predictions = model(torch.tensor([tokenizer.encode(input_text)]))
|
| 11 |
predictions=torch.nn.functional.softmax(predictions.logits,dim=-1)
|
| 12 |
+
print(predictions)
|
| 13 |
return input_text, {p["label"]: p["score"] for p in predictions}
|
| 14 |
|
| 15 |
gradio_app = gr.Interface(
|