MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / fingerprint_piece

Function fingerprint_piece

src/framework/tokenizers/sentencepiece.cpp:40–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40size_t fingerprint_piece(const SentencePiecePiece & piece) {
41 size_t seed = std::hash<int>{}(piece.id);
42 seed = hash_combine(seed, std::hash<std::string>{}(piece.text));
43 seed = hash_combine(seed, std::hash<int>{}(static_cast<int>(piece.type)));
44 seed = hash_combine(seed, std::hash<int32_t>{}(static_cast<int32_t>(piece.score * 1000000.0F)));
45 return seed;
46}
47
48size_t fingerprint_pieces(const std::vector<SentencePiecePiece> & pieces) {
49 size_t seed = std::hash<size_t>{}(pieces.size());

Callers 1

fingerprint_piecesFunction · 0.85

Calls 1

hash_combineFunction · 0.85

Tested by

no test coverage detected