MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / _encode_pair

Method _encode_pair

test/general/lm_eval/base.py:201–210  ·  view source on GitHub ↗
(self, context, continuation)

Source from the content-addressed store, hash-verified

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 = []

Callers 1

loglikelihoodMethod · 0.95

Calls 1

tok_encodeMethod · 0.95

Tested by

no test coverage detected