Spaces:
Runtime error
Runtime error
added one dimension into my tokenized data
Browse files
app.py
CHANGED
|
@@ -21,8 +21,8 @@ def model_classifier(text):
|
|
| 21 |
attention_mask=encoded_input["attention_mask"]
|
| 22 |
|
| 23 |
#turning the inputs into tensors
|
| 24 |
-
inputs_ids=torch.tensor(input_ids)
|
| 25 |
-
attention_mask=torch.tensor(attention_mask)
|
| 26 |
|
| 27 |
logits=model(input_ids,attention_mask).logits #this is the logits of the labels
|
| 28 |
probs_label=softmax(logits,dim=-1) #turning the probability distribution into normalize form
|
|
|
|
| 21 |
attention_mask=encoded_input["attention_mask"]
|
| 22 |
|
| 23 |
#turning the inputs into tensors
|
| 24 |
+
inputs_ids=torch.tensor(input_ids).unsqueeze(dim=0)
|
| 25 |
+
attention_mask=torch.tensor(attention_mask).unsqueeze(dim=0)
|
| 26 |
|
| 27 |
logits=model(input_ids,attention_mask).logits #this is the logits of the labels
|
| 28 |
probs_label=softmax(logits,dim=-1) #turning the probability distribution into normalize form
|