(self, requests)
| 210 | return context_enc, continuation_enc |
| 211 | |
| 212 | def loglikelihood(self, requests): |
| 213 | new_reqs = [] |
| 214 | for context, continuation in requests: |
| 215 | if context == "": |
| 216 | # end of text as context |
| 217 | context_enc, continuation_enc = [self.eot_token_id], self.tok_encode( |
| 218 | continuation |
| 219 | ) |
| 220 | else: |
| 221 | context_enc, continuation_enc = self._encode_pair(context, continuation) |
| 222 | |
| 223 | new_reqs.append(((context, continuation), context_enc, continuation_enc)) |
| 224 | |
| 225 | return self._loglikelihood_tokens(new_reqs) |
| 226 | |
| 227 | def loglikelihood_rolling(self, requests): |
| 228 | # TODO: Implement caching once we've confirmed the perplexity implementation |
nothing calls this directly
no test coverage detected