Files
ktransformers/kt-sft/test_adapter/data_transfer.py
Peilin LiandZiWei Yuan 171578a7ec [refactor]: Change named 'KT-SFT' to 'kt-sft' (#1626)
* Change named 'KT-SFT' to 'kt-sft'

* [docs]: update kt-sft name

---------

Co-authored-by: ZiWei Yuan <yzwliam@126.com>
2025-11-17 11:48:42 +08:00

14 lines
520 B
Python

import json
converted_data = []
with open('/data/user23202791/lpl/LLaMA-Factory/examples/KT_used/translation.jsonl', 'r', encoding='utf-8') as f:
for line in f:
data = json.loads(line)
converted_data.append({
"instruction": "",
"input": data["问"],
"output": data["答"]
})
with open('/data/user23202791/lpl/LLaMA-Factory/examples/KT_used/sft_translation.json', 'w', encoding='utf-8') as f:
json.dump(converted_data, f, ensure_ascii=False, indent=4)