buyun's picture
initial
e70375e verified
raw
history blame
389 Bytes
import json
from pathlib import Path
import sys
config = sys.argv[1]
token_list_out = sys.argv[2]
config = Path(config)
token_list = []
with config.open("r", encoding="utf-8") as f:
for idx, line in enumerate(f):
line = line.rstrip()
token_list.append(line)
file = open(token_list_out, 'w', encoding='utf-8')
json.dump(token_list, file, ensure_ascii=False, indent=4)
file.close()