mirror of
https://github.com/skindhu/Build-A-Large-Language-Model-CN.git
synced 2026-08-29 21:30:25 +08:00
Merge pull request #30 from FMLS/patch-1
Revise token ID list and corresponding explanations
This commit is contained in:
@@ -448,13 +448,13 @@ tokenizer = SimpleTokenizerV2(vocab)
|
||||
print(tokenizer.encode(text))
|
||||
```
|
||||
|
||||
这将输出以下token ID列表:
|
||||
这将打印以下词元ID:
|
||||
|
||||
```
|
||||
[1160, 5, 362, 1155, 642, 1000, 10, 1159, 57, 1013, 981, 1009, 738, 1013, 1160, 7]
|
||||
[1131, 5, 355, 1126, 628, 975, 10, 1130, 55, 988, 956, 984, 722, 988, 1131, 7]
|
||||
```
|
||||
|
||||
从上面的内容可以看出,token ID 列表中包含了 1159 ,它对应于 <|endoftext|> 分隔token,以及两个 1160 ,用于表示未知单词。
|
||||
从上面的内容可以看出,token ID 列表中包含了 1130 ,它对应于 <|endoftext|> 分隔token,以及两个 1131 ,用于表示未知单词。
|
||||
|
||||
```python
|
||||
print(tokenizer.decode(tokenizer.encode(text)))
|
||||
|
||||
Reference in New Issue
Block a user