| 401 | } |
| 402 | |
| 403 | void TMMapBpeDictionary::InitFromMemory(const void* data, size_t size) { |
| 404 | const ui8* ptr = reinterpret_cast<const ui8*>(data); |
| 405 | Y_ENSURE(!std::memcmp(ptr, BPE_MAGIC, BPE_MAGIC_SIZE)); |
| 406 | ptr += 16; |
| 407 | |
| 408 | BpeSize = *reinterpret_cast<const ui64*>(ptr); |
| 409 | ptr += 16; |
| 410 | |
| 411 | ui64 sourceTokenIdsToTokenIdSize = *reinterpret_cast<const ui64*>(ptr); |
| 412 | ptr += 8; |
| 413 | SourceTokenIdsToTokenIdSeed = *reinterpret_cast<const ui64*>(ptr); |
| 414 | ptr += 8; |
| 415 | |
| 416 | const TBucket* bucketDataBegin = reinterpret_cast<const TBucket*>(ptr); |
| 417 | const TBucket* bucketDataEnd = reinterpret_cast<const TBucket*>(ptr + sourceTokenIdsToTokenIdSize); |
| 418 | SourceTokenIdsToTokenId = MakeArrayRef(bucketDataBegin, bucketDataEnd); |
| 419 | Y_ENSURE(size == 16 + 16 + 16 + sourceTokenIdsToTokenIdSize); |
| 420 | } |
nothing calls this directly
no test coverage detected