Tsukihjy/testcase / methods /Predo /prompt_to_jsonl.py
Tsukihjy's picture
download
raw
1.2 kB
from prompt import test_gen_prompt, predo_prompt, input_template, System_prompt
from config import cfg
import sys
sys.path.append("/home/luoxianzhen/yang/methods/utils")
from dataset_all import get_datasets_by_name, get_ours
def get_datasets_prompt():
al_dataset = get_datasets_by_name(cfg.dataset_name)
print(len(al_dataset))
prompt_list = []
for item in al_dataset:
tcb_id = item["tcb_id"]
random_generator = {
"tcb_id": tcb_id,
"type": "input",
"system_prompt": test_gen_prompt,
"user_prompt": input_template.replace("[[Question]]", item["query_en"])
}
prompt_list += [random_generator, ] * 10
oracle_generator = {
"tcb_id": tcb_id,
"type": "answer",
"system_prompt": System_prompt,
"user_prompt": predo_prompt.replace("{question}", item['query_en'])
}
prompt_list += [oracle_generator, ] * 20
return prompt_list
import json
data = get_datasets_prompt()
json.dump(data, open(f"/home/luoxianzhen/yang/data/prompt_saves/|qwen3-235b-a22b|predo|.json", "w", encoding="utf-8"), indent=4, ensure_ascii=False)

Xet Storage Details

Size:
1.2 kB
·
Xet hash:
31c69cd1cc2debd02f9a865ecb19f75231d93bf4d38ea47733235b52f1d45a59

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