mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-05-02 05:31:47 +00:00
14 lines
No EOL
520 B
Python
14 lines
No EOL
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) |