I have noticed across all of my Jupyter notebooks stored as Github Gists that newlines have been added to them, in both new and old notebooks. Am I doing something wrong? Here is an example:
The code for the first block is:
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([30522])"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import torch\n",
"\n",
"vec = torch.max(\n",
" torch.log(\n",
" 1 + torch.relu(output.logits)\n",
" ) * tokens.attention_mask.unsqueeze(-1),\n",
"dim=1)[0].squeeze()\n",
"\n",
"vec.shape"
]
}
And the link
