Update claspp_forward.py
Browse files- claspp_forward.py +5 -5
claspp_forward.py
CHANGED
|
@@ -236,12 +236,12 @@ def predict(input_batches):
|
|
| 236 |
# print(torch.tensor([tokenizer(batches)['input_ids']]).cuda().shape)
|
| 237 |
# print(torch.tensor([tokenizer(batches)['attention_mask']]).cuda()["logits"][0].shape)
|
| 238 |
#print(torch.tensor([tokenizer(batches)['input_ids']]).cuda().squeeze().shape)
|
| 239 |
-
print(tokenizer(batches)['input_ids'])
|
| 240 |
-
print(torch.tensor([tokenizer(batches)['input_ids']]).squeeze().cuda())
|
| 241 |
pred=(sig(model(torch.tensor([tokenizer(batches)['input_ids']]).squeeze().cuda(),torch.tensor([tokenizer(batches)['attention_mask']]).squeeze().cuda())["logits"]).tolist())
|
| 242 |
#print(len(pred[0]))
|
| 243 |
for p in pred:
|
| 244 |
-
print(p)
|
| 245 |
outputpreds.append(p)
|
| 246 |
return outputpreds
|
| 247 |
|
|
@@ -392,8 +392,8 @@ def main():
|
|
| 392 |
continue
|
| 393 |
temp.append(pep.replace("-", "<pad>"))
|
| 394 |
input_batches.append(temp)
|
| 395 |
-
print(listofpeps)
|
| 396 |
-
print(input_batches)
|
| 397 |
pred=predict(input_batches=input_batches)
|
| 398 |
write_output(pred,listofpeps,file_output)
|
| 399 |
|
|
|
|
| 236 |
# print(torch.tensor([tokenizer(batches)['input_ids']]).cuda().shape)
|
| 237 |
# print(torch.tensor([tokenizer(batches)['attention_mask']]).cuda()["logits"][0].shape)
|
| 238 |
#print(torch.tensor([tokenizer(batches)['input_ids']]).cuda().squeeze().shape)
|
| 239 |
+
# print(tokenizer(batches)['input_ids'])
|
| 240 |
+
# print(torch.tensor([tokenizer(batches)['input_ids']]).squeeze().cuda())
|
| 241 |
pred=(sig(model(torch.tensor([tokenizer(batches)['input_ids']]).squeeze().cuda(),torch.tensor([tokenizer(batches)['attention_mask']]).squeeze().cuda())["logits"]).tolist())
|
| 242 |
#print(len(pred[0]))
|
| 243 |
for p in pred:
|
| 244 |
+
# print(p)
|
| 245 |
outputpreds.append(p)
|
| 246 |
return outputpreds
|
| 247 |
|
|
|
|
| 392 |
continue
|
| 393 |
temp.append(pep.replace("-", "<pad>"))
|
| 394 |
input_batches.append(temp)
|
| 395 |
+
# print(listofpeps)
|
| 396 |
+
# print(input_batches)
|
| 397 |
pred=predict(input_batches=input_batches)
|
| 398 |
write_output(pred,listofpeps,file_output)
|
| 399 |
|