MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / format_example

Method format_example

test/general/lm_eval/tasks/logiqa.py:56–72  ·  view source on GitHub ↗

Passage: Question: Choices: A. B. C. D. Answer:

(doc, choices)

Source from the content-addressed store, hash-verified

54
55 def _process_doc(self, doc):
56 def format_example(doc, choices):
57 """
58 Passage: <passage>
59 Question: <question>
60 Choices:
61 A. <choice1>
62 B. <choice2>
63 C. <choice3>
64 D. <choice4>
65 Answer:
66 """
67 prompt = "Passage: " + doc["context"] + "\n"
68 prompt += "Question: " + doc["question"] + "\nChoices:\n"
69 for choice, option in zip(choices, doc["options"]):
70 prompt += f"{choice.upper()}. {option}\n"
71 prompt += "Answer:"
72 return prompt
73
74 choices = ["a", "b", "c", "d"]
75 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected