From 592cc35a7a6a8ba0a9cd5d51f8a24708ce93e32b Mon Sep 17 00:00:00 2001 From: long_long_ago <149533107@qq.com> Date: Sun, 7 Sep 2025 09:02:42 +0800 Subject: [PATCH] =?UTF-8?q?Update=205.=E5=9C=A8=E6=97=A0=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E4=B8=8A=E8=BF=9B=E8=A1=8C=E9=A2=84?= =?UTF-8?q?=E8=AE=AD=E7=BB=83.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复代码错误 --- cn-Book/5.在无标记数据集上进行预训练.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cn-Book/5.在无标记数据集上进行预训练.md b/cn-Book/5.在无标记数据集上进行预训练.md index eaa07fd..a9d5944 100644 --- a/cn-Book/5.在无标记数据集上进行预训练.md +++ b/cn-Book/5.在无标记数据集上进行预训练.md @@ -158,7 +158,7 @@ inputs = torch.tensor([[16833, 3626, 6100], # ["every effort moves", [40, 1107, 588]]) # "I really like"] # Matching these inputs, the `targets` contain the token IDs we aim for the model to produce: targets = torch.tensor([[3626, 6100, 345 ], # [" effort moves you", - [107, 588, 11311]]) # " really like chocolate"] + [1107, 588, 11311]]) # " really like chocolate"] ``` 需要注意的是,目标值中展示的是输入数据向前偏移了一个位置。我们在第 2 章实现数据加载器时已介绍过这一概念。这种偏移策略对于教会模型预测序列中的下一个 token 至关重要。