# prompts/cot.py from utils.logger import log_output def apply_cot_prompt(question: str) -> str: return ( f"Solve the following problem step by step with the fromat of LaTex:\n" f"{question}\n\n" f"Clearly show your reasoning and your answer.\n" ) def apply_cot_answer(question: str, model, dataset: str, model_name: str, qid: int, prompt_method="cot") -> str: prompt = apply_cot_prompt(question) answer = model.generate(prompt) log_output(dataset, model_name, prompt_method, qid, { "question": question, "answer": answer }) return answer