Section5 Pt

chapter2zh-CNhf-notebookscourse

处理多个序列 (PyTorch)

Install the Transformers, Datasets, and Evaluate libraries to run this notebook.

[ ]
[ ]
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
[ ]
tensor([[  101,  1045,  1005,  2310,  2042,  3403,  2005,  1037, 17662, 12172,
,          2607,  2026,  2878,  2166,  1012,   102]])
[ ]
Input IDs: [[ 1045,  1005,  2310,  2042,  3403,  2005,  1037, 17662, 12172,  2607, 2026,  2878,  2166,  1012]]
,Logits: [[-2.7276,  2.8789]]
[ ]
[ ]
[ ]
tensor([[ 1.5694, -1.3895]], grad_fn=<AddmmBackward>)
,tensor([[ 0.5803, -0.4125]], grad_fn=<AddmmBackward>)
,tensor([[ 1.5694, -1.3895],
,        [ 1.3373, -1.2163]], grad_fn=<AddmmBackward>)
[ ]
tensor([[ 1.5694, -1.3895],
,        [ 0.5803, -0.4125]], grad_fn=<AddmmBackward>)
[ ]