File size: 564 Bytes
63c6bf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# prompts/zero_shot.py

from utils.logger import log_output

def apply_zero_shot_prompt(question: str) -> str:
    return f"Solve the following problem with the fromat of LaTex in 512 tokens:\n{question}\n\nAnswer:"

def apply_zero_shot_answer(question: str, model, dataset: str, model_name: str, qid: int, prompt_method="zero_shot") -> str:
    prompt = apply_zero_shot_prompt(question)
    answer = model.generate(prompt)

    log_output(dataset, model_name, prompt_method, qid, {
        "question": question,
        "answer": answer
    })

    return answer