update data gen/def

This commit is contained in:
51616 2025-09-06 08:43:36 +00:00
parent cfe737d106
commit 0c1a8bb3e8
5 changed files with 76 additions and 46 deletions

View file

@ -3,8 +3,6 @@ import gc
from datasets import Dataset, load_dataset
from tqdm import tqdm
from ctx_to_lora.data.preprocessing_fn import closed_qa_prompting
if __name__ == "__main__":
ds_name = "data/raw_datasets/squad"
@ -16,7 +14,7 @@ if __name__ == "__main__":
ctx = sample["context"]
if ctx not in ctx_qa_dict:
ctx_qa_dict[ctx] = {"prompts": [], "responses": []}
question = closed_qa_prompting(sample["question"])
question = sample["question"]
answer = sample["answers"]["text"][0]
ctx_qa_dict[ctx]["prompts"].append(question)
ctx_qa_dict[ctx]["responses"].append(answer)