From 985f933859fa02f8163126aa68372c00d4843abc Mon Sep 17 00:00:00 2001 From: Dominic Zimmer Date: Fri, 26 Aug 2022 12:44:52 +0200 Subject: [PATCH] Mix easy and hard prompts --- bingo/generate_bingo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bingo/generate_bingo.py b/bingo/generate_bingo.py index e09a9e2..2390b0f 100644 --- a/bingo/generate_bingo.py +++ b/bingo/generate_bingo.py @@ -14,6 +14,7 @@ with open("prompts.txt") as f: stripped = "".join(raw_sentences).strip().split("\n") sentences["easy"] = [ line for line in stripped if "*" not in line ] sentences["hard"] = [ line.replace("*","") for line in stripped if "*" in line ] + sentences["all"] = [ line.replace("*","") for line in stripped ] print(f"[INFO] Found {len(sentences['easy'])} easy prompts") print(f"[INFO] Found {len(sentences['hard'])} hard prompts") @@ -22,7 +23,7 @@ print(f"[INFO] Found {len(sentences['hard'])} hard prompts") """ Postprocess the content string to look nice in the latex tabular cell """ def make_cell(content: str): return fr"""\vspace{{0.5cm}} - \rule{{3cm}}{{0.15mm}} \, \newline \small {content} + \rule{{3cm}}{{0.15mm}} \, \vspace{{.3cm}} \newline \small {content} \vspace{{0.5cm}}""" def substitute_texts(text: str, substitutions: list[str]): @@ -39,7 +40,8 @@ def gen_board(num: int = 1): print(f"Generating {num} boards") for i in range(1, num+1): - prompts = [ *random.sample(sentences["easy"], num_easy), *random.sample(sentences["hard"], num_hard) ] + #prompts = [ *random.sample(sentences["easy"], num_easy), *random.sample(sentences["hard"], num_hard) ] + prompts = [ *random.sample(sentences["all"], num_total) ] random.shuffle(prompts) pick = substitute_texts(latex_template, prompts)