14 lines
367 B
Python
14 lines
367 B
Python
import numpy as np
|
||
|
||
# 读取 npz 文件
|
||
data = np.load("dataset/represented_data/tuneidx/tuneidx_Melody/octuple8/AIDemo-recuKqEwVxsfij.npz", allow_pickle=True)
|
||
|
||
# 查看保存的键
|
||
print(data.files)
|
||
# 输出:['filename', 'sequence']
|
||
|
||
# 访问数据
|
||
sequence = data["arr_0"]
|
||
|
||
print("token 序列长度:", len(sequence))
|
||
print("前 20 个 token:", sequence[:20]) |