Thank you for your message.
The shape of x is [1,64] and y is [1,6]. In the for statement, x shape = [64] and y shape = [6]
The error location is as follows.
for epoch in range(6):
    for i, (s, y) in enumerate(training_pairs):
        optimizer.zero_grad(); output = model(s.float())
        loss = criterion(output.unsqueeze(0),  y.unsqueeze(0).long()) ☚here is error cord
        loss.backward(); optimizer.step()