MCPcopy
hub / github.com/EleutherAI/lm-evaluation-harness / fewshot_docs

Method fewshot_docs

lm_eval/api/task.py:204–219  ·  view source on GitHub ↗

:return: Iterable[obj] A iterable of any object, that doc_to_text can handle

(self)

Source from the content-addressed store, hash-verified

202 return []
203
204 def fewshot_docs(self) -> Iterable:
205 """
206 :return: Iterable[obj]
207 A iterable of any object, that doc_to_text can handle
208 """
209 if self.has_training_docs():
210 return self.training_docs()
211 elif self.has_validation_docs():
212 return self.validation_docs()
213 else:
214 if self.config.get("num_fewshot", 0) > 0:
215 eval_logger.warning(
216 f"[Task: {self.config.task}] has_training_docs and has_validation_docs are False"
217 ", using test_docs as fewshot_docs but this is not recommended."
218 )
219 return self.test_docs()
220
221 def _process_doc(self, doc: dict) -> dict:
222 """

Callers 1

fewshot_docsMethod · 0.45

Calls 6

has_training_docsMethod · 0.95
training_docsMethod · 0.95
has_validation_docsMethod · 0.95
validation_docsMethod · 0.95
test_docsMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected