Update 5.在无标记数据集上进行预训练.md

This commit is contained in:
yuhui 2025-04-14 19:01:19 +08:00 committed by GitHub
parent 60bbaa8712
commit 299822cf07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -422,7 +422,7 @@ tensor(10.7940)
```python
file_path = "the-verdict.txt"
with open(file_path, "r", encoding="utf-8") as file:
text_data = file.read()
text_data = file.read()
```
加载数据集后,我们可以查看其中的字符数和 token 数:
@ -1447,4 +1447,4 @@ What makes us want to be on top of that?
+ 训练集和验证集的损失可以用来评估 LLM 在训练过程中生成文本的质量。
+ 预训练 LLM 的过程就是通过调整模型权重来最小化训练损失。
+ LLM 的训练循环是深度学习中的标准流程,通常使用交叉熵损失和 AdamW 优化器。
+ 在大规模文本数据集上预训练 LLM 非常耗费时间和资源,因此可以加载 OpenAI 提供的开源预训练权重,作为自行预训练模型的替代方案。
+ 在大规模文本数据集上预训练 LLM 非常耗费时间和资源,因此可以加载 OpenAI 提供的开源预训练权重,作为自行预训练模型的替代方案。