mirror of
https://github.com/wassname/bert_adapter.git
synced 2026-06-27 16:29:32 +08:00
fix
This commit is contained in:
+2
-2
@@ -111,7 +111,7 @@ if __name__ == '__main__':
|
||||
predictions.append(torch.argmax(logits, dim=1))
|
||||
labels = torch.cat(labels).long()
|
||||
predictions = torch.cat(predictions).long()
|
||||
print(f'Epoch: {i}\tVal Accuracy: {(labels == predictions).mean()}')
|
||||
print(f'Epoch: {i}\tVal Accuracy: {(labels == predictions).float().mean()}')
|
||||
|
||||
model.eval()
|
||||
labels = []
|
||||
@@ -132,4 +132,4 @@ if __name__ == '__main__':
|
||||
predictions.append(torch.argmax(logits, dim=1))
|
||||
labels = torch.cat(labels).long()
|
||||
predictions = torch.cat(predictions).long()
|
||||
print(f'Epoch: {i}\tTest Accuracy: {(labels == predictions).mean()}')
|
||||
print(f'Epoch: {i}\tTest Accuracy: {(labels == predictions).float().mean()}')
|
||||
|
||||
Reference in New Issue
Block a user