(self, context, continuation)
| 199 | # TODO: enforce this somehow |
| 200 | |
| 201 | def _encode_pair(self, context, continuation): |
| 202 | n_spaces = len(context) - len(context.rstrip()) |
| 203 | if n_spaces > 0: |
| 204 | continuation = context[-n_spaces:] + continuation |
| 205 | context = context[:-n_spaces] |
| 206 | whole_enc = self.tok_encode(context + continuation) |
| 207 | context_enc = self.tok_encode(context) |
| 208 | context_enc_len = len(context_enc) |
| 209 | continuation_enc = whole_enc[context_enc_len:] |
| 210 | return context_enc, continuation_enc |
| 211 | |
| 212 | def loglikelihood(self, requests): |
| 213 | new_reqs = [] |
no test coverage detected