MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / num_tokens_in_example

Method num_tokens_in_example

seq2seq/utils.py:177–178  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

175 sorted_indices = list(self.make_sortish_sampler(1024, shuffle=False))
176
177 def num_tokens_in_example(i):
178 return min(self.src_lens[i], self.max_target_length)
179
180 # call fairseq cython function
181 batch_sampler: List[List[int]] = batch_by_size(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected