Check the Index and Token from Tiktoken
作者:XD / 发表: 2024年2月4日 01:27 / 更新: 2024年2月4日 01:46 / 编程笔记 / 阅读量:742
Check the Index and Token from Tiktoken
import base64
path = "/home/your_dict_path.tiktoken"
f = open(path, "rb").read()
index = 0
for line in f.splitlines():
l = line.split()
print("index: ", l[1])
print("encode: ", l[0])
print("decode: ", base64.b64decode(l[0]))
index += 1
if index > 20:
break