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

Method construct_requests

test/general/lm_eval/tasks/race.py:128–143  ·  view source on GitHub ↗

Uses RequestFactory to construct Requests and returns an iterable of Requests which will be sent to the LM. :param doc: The document as returned from training_docs, validation_docs, or test_docs. :param ctx: str The context string, generated by fewsho

(self, doc, ctx)

Source from the content-addressed store, hash-verified

126 return " " + self.get_answer_option(self.last_problem(doc))
127
128 def construct_requests(self, doc, ctx):
129 """Uses RequestFactory to construct Requests and returns an iterable of
130 Requests which will be sent to the LM.
131
132 :param doc:
133 The document as returned from training_docs, validation_docs, or test_docs.
134 :param ctx: str
135 The context string, generated by fewshot_context. This includes the natural
136 language description, as well as the few shot examples, and the question
137 part of the document for `doc`.
138 """
139 problem = self.last_problem(doc)
140 ll_choices = [
141 rf.loglikelihood(ctx, " " + problem["options"][i])[0] for i in range(4)
142 ]
143 return ll_choices
144
145 def process_results(self, doc, results):
146 """Take a single document and the LM results and evaluates, returning a

Callers

nothing calls this directly

Calls 2

last_problemMethod · 0.95
loglikelihoodMethod · 0.45

Tested by

no test coverage detected