cwenzi/neuroflow-cpp-bucket / scripts /check_json_format.py
cwenzi's picture
download
raw
677 Bytes
import json
path = r'D:\neuroflow-C++\configs\tokenizer_128k.json'
with open(path, 'r', encoding='utf-8') as f:
content = f.read()
print('Lines:', content.count('\n'))
print('Size:', len(content))
# Find vocab section
idx = content.find('"vocab"')
print('vocab key at position:', idx)
if idx > 0:
print('Context:', repr(content[idx:idx+50]))
# The C++ parse_config looks for "\"vocab\":{" or "\"vocab\": {"
# With indent=2, it's likely "\"vocab\": {"
pattern1 = '"vocab": {'
pattern2 = '"vocab":{'
p1 = content.find(pattern1)
p2 = content.find(pattern2)
print(f'Pattern "{pattern1}" found at:', p1)
print(f'Pattern "{pattern2}" found at:', p2)

Xet Storage Details

Size:
677 Bytes
·
Xet hash:
9b5aa883412ba42536bd9bbf4011983c1652c9a35166d8d208542b2fe02f947f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.