(cls, ctx, partial_ctx)
| 100 | |
| 101 | @classmethod |
| 102 | def append_context(cls, ctx, partial_ctx): |
| 103 | ctx = ctx.split("\n\n") # Each fewshot context is on its own new line. |
| 104 | ctx.pop() # Remove the correct context put in by `doc_to_text`. |
| 105 | return "\n\n".join([*ctx, partial_ctx]) if ctx else partial_ctx |
| 106 | |
| 107 | def process_results(self, doc, results): |
| 108 | """Take a single document and the LM results and evaluates, returning a |