Spaces:
Running
Running
adamtayzzz
commited on
Commit
•
b84d9de
1
Parent(s):
ff58e64
Update whitebox_utils/classifier.py
Browse files
whitebox_utils/classifier.py
CHANGED
@@ -112,7 +112,6 @@ class MyClassifier():
|
|
112 |
batch = self.tokenize(sent,idx=self.count)
|
113 |
inputs = {"input_ids": batch[0], "attention_mask": batch[1], "token_type_ids":batch[2]}
|
114 |
outputs = self.model(**inputs)[0] # get all logits
|
115 |
-
|
116 |
-
output_ = [torch.softmax(output,dim=1)[0].detach().cpu().numpy() for output in outputs]
|
117 |
ret.append(output_)
|
118 |
return np.array(ret)
|
|
|
112 |
batch = self.tokenize(sent,idx=self.count)
|
113 |
inputs = {"input_ids": batch[0], "attention_mask": batch[1], "token_type_ids":batch[2]}
|
114 |
outputs = self.model(**inputs)[0] # get all logits
|
115 |
+
output_ = torch.softmax(outputs,dim=1)[0].detach().cpu().numpy()
|
|
|
116 |
ret.append(output_)
|
117 |
return np.array(ret)
|