| 72 | |
| 73 | |
| 74 | class FirstNSampler(ContextSampler): |
| 75 | def sample(self, n) -> None: |
| 76 | """ |
| 77 | Draw the first `n` samples in order from the specified split. |
| 78 | Used for tasks with "canonical" ordered fewshot examples, such as MMLU and CMMLU. |
| 79 | """ |
| 80 | assert ( |
| 81 | n <= len(self.docs) |
| 82 | ), f"Error: number of fewshot samples requested exceeds the {len(self.docs)} that are available." |
| 83 | return self.docs[:n] |
| 84 | |
| 85 | |
| 86 | class BalancedSampler(ContextSampler): |
nothing calls this directly
no outgoing calls
no test coverage detected