mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
some typo fixes (#858)
* fix(typo): correct scaling * fix(typo): correct comment for `instruct`
This commit is contained in:
@@ -334,7 +334,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"id": "9a6bd0a2-f27c-4602-afa0-c96cd295c1a6",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
@@ -395,7 +395,7 @@
|
||||
" self.mask.bool()[:num_tokens, :num_tokens], -torch.inf\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" attn_weights = torch.softmax(attn_scores / keys.shape[-1]**-0.5, dim=-1)\n",
|
||||
" attn_weights = torch.softmax(attn_scores / keys.shape[-1]**0.5, dim=-1)\n",
|
||||
" attn_weights = self.dropout(attn_weights)\n",
|
||||
"\n",
|
||||
" # (b, num_heads, num_tokens, num_tokens) --> (b, num_heads, num_tokens, head_dim)\n",
|
||||
|
||||
Reference in New Issue
Block a user