Crates.io | sentencepiece-model |
lib.rs | sentencepiece-model |
version | 0.1.2 |
source | src |
created_at | 2023-11-18 14:31:03.094167 |
updated_at | 2024-07-04 09:26:40.813638 |
description | SentencePiece model parser generated from the SentencePiece protobuf definition |
homepage | |
repository | https://github.com/Systemcluster/sentencepiece-model |
max_upload_size | |
id | 1040527 |
size | 28,744 |
SentencePiece model parser generated from the SentencePiece protobuf definition.
use sentencepiece_model::SentencePieceModel;
let model = SentencePieceModel::from_file("tests/t5-spiece.model")?;
assert_eq!(model.pieces.len(), 32000);
assert_eq!(model.trainer()?.unk_id(), 2);
[dependencies]
sentencepiece-model = "0.1"
sentencepiece-model
uses prost-build
and protoc
to generate Rust code from the SentencePiece protobuf definition.
If an existing protoc
binary is not found in the path, the build script will download it from the protobuf releases during the first build.