MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / slice_columns

Method slice_columns

fastdeploy/worker/output.py:49–58  ·  view source on GitHub ↗

Slice columns (per-row top-k logprobs and token IDs). Keeps the number of requests unchanged.

(self, start: int, end: int)

Source from the content-addressed store, hash-verified

47 sampled_token_ranks: list[int]
48
49 def slice_columns(self, start: int, end: int):
50 """
51 Slice columns (per-row top-k logprobs and token IDs).
52 Keeps the number of requests unchanged.
53 """
54 return LogprobsLists(
55 [row[start:end] for row in self.logprob_token_ids],
56 [row[start:end] for row in self.logprobs],
57 self.sampled_token_ranks, # unchanged
58 )
59
60 def slice_rows(self, start: int, end: int):
61 """

Callers 2

test_logprobs_outputMethod · 0.80

Calls 1

LogprobsListsClass · 0.85

Tested by 1

test_logprobs_outputMethod · 0.64