Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save freedomtowin/2c1a0790f892543840ca65b5bb0d6004 to your computer and use it in GitHub Desktop.
Save freedomtowin/2c1a0790f892543840ca65b5bb0d6004 to your computer and use it in GitHub Desktop.
Example of creating a Gist using Python
Inputs: {'input_ids': tensor([[ 101, 1045, 1005, 2310, 2042, 3403, 2005, 1037, 17662, 12172,
2607, 2026, 2878, 2166, 1012, 102],
[ 101, 1045, 5223, 2023, 2061, 2172, 999, 102, 0, 0,
0, 0, 0, 0, 0, 0]]),
'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]])
}
Logits: tensor([[-1.5607, 1.6123],
[ 4.1692, -3.3464]], grad_fn=\<AddmmBackward0>)
Predictions: tensor([[4.0195e-02, 9.5980e-01],
[9.9946e-01, 5.4418e-04]], grad_fn=\<SoftmaxBackward0>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment