fix: load task data files only for selected tasks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,15 +100,16 @@ def main():
|
||||
rng = random.Random(SEED)
|
||||
torch.manual_seed(SEED)
|
||||
|
||||
gsm = [dict(it, task="gsm") for it in json.load(open(OUT / "star_data.json"))
|
||||
if it["split"] == "train" and it["label"] != "drop"]
|
||||
mbpp = [dict(it, task="mbpp") for it in json.load(open(OUT / "mbpp_data.json"))
|
||||
if it["split"] == "train" and it["label"] != "drop"
|
||||
and it.get("sol_code")]
|
||||
if "gsm" not in tasks:
|
||||
gsm = []
|
||||
if "mbpp" not in tasks:
|
||||
mbpp = []
|
||||
gsm, mbpp = [], []
|
||||
if "gsm" in tasks:
|
||||
gsm = [dict(it, task="gsm")
|
||||
for it in json.load(open(OUT / "star_data.json"))
|
||||
if it["split"] == "train" and it["label"] != "drop"]
|
||||
if "mbpp" in tasks:
|
||||
mbpp = [dict(it, task="mbpp")
|
||||
for it in json.load(open(OUT / "mbpp_data.json"))
|
||||
if it["split"] == "train" and it["label"] != "drop"
|
||||
and it.get("sol_code")]
|
||||
|
||||
model, tok = load_model(dtype=torch.bfloat16)
|
||||
for p in model.parameters():
|
||||
|
||||
Reference in New Issue
Block a user