MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / finalize

Method finalize

plugins/wasi_nn/MLX/model/whisper/decoding.cpp:169–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169std::pair<mx::array, mx::array>
170GreedyDecoder::finalize(const mx::array &Tokens, const mx::array &SumLogprobs) {
171
172 // Make sure each sequence has at least one EOT token at the end
173 std::vector<std::pair<int, int>> PadWidths = {{0, 0}, {0, 0}, {0, 1}};
174 mx::array PaddedTokens =
175 mx::pad(Tokens, PadWidths, mx::array(Eot, mx::int32));
176
177 return {PaddedTokens, SumLogprobs};
178}
179
180// SuppressBlank implementation
181SuppressBlank::SuppressBlank(std::shared_ptr<whisper::Tokenizer> Tokenizer,

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected