(self, doc, ctx)
| 85 | return "" |
| 86 | |
| 87 | def construct_requests(self, doc, ctx): |
| 88 | assert not ctx |
| 89 | |
| 90 | # Calculate the loglikelihood for the good and the bad sentence. |
| 91 | # Note that loglikelihood translates the "" prefix to the "<|endoftext|>" token |
| 92 | return [ |
| 93 | rf.loglikelihood("", doc["sentence_good"]), |
| 94 | rf.loglikelihood("", doc["sentence_bad"]), |
| 95 | ] |
| 96 | |
| 97 | def process_results(self, doc, results): |
| 98 | likelihood1, likelihood2 = results |
nothing calls this directly
no test coverage detected