In train function:
total_loss += loss.item()
total_acc += (torch.round(torch.sigmoid(predicted)) == label).sum().item()

In collate.
def collate_batch(batch):
    label_list, text_list = [], []
    for _label, _text in batch:
        label_list.append(torch.FloatTensor([_label]))
        text = torch.tensor(_text, dtype=torch.int64)
        text_list.append(text)

    label_list = torch.stack(label_list)
    text_list = torch.stack(text_list)
    
    return label_list.to(device), text_list.to(device)

I am sorry, I am newbie to programming.