Skip to main content

rs-bytepiece

Install

pip install rs_bytepiece

Usage

from rs_bytepiece import Tokenizer

tokenizer = Tokenizer()
# a custom model
tokenizer = Tokenizer("/path/to/model")
ids = tokenizer.encode("今天天气不错")
text = tokenizer.decode(ids)

Performance

The performance is a bit faster than the original implementation. I've tested (on my M2 16G) the《鲁迅全集》which has 625890 chars. The time unit is millisecond.

length jieba aho_py aho_cy aho_rs
100 17062.12 1404.37 564.31 112.94
1000 17104.38 1424.6 573.32 113.18
10000 17432.58 1429.0 574.93 110.03
100000 17228.17 1401.01 574.5 110.44
625890 17305.95 1419.79 567.78 108.54

Metadata

Release files for rs-bytepiece 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rs-bytepiece 0.2.2
File Size Uploaded Provenance Actions
rs_bytepiece-0.2.2.tar.gz 1.2 MB Without provenance Details for rs_bytepiece-0.2.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rs-bytepiece 0.2.2
File Interpreter ABI Platform Actions
rs_bytepiece-0.2.2-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details for rs_bytepiece-0.2.2-cp37-abi3-win_amd64.whl
rs_bytepiece-0.2.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details for rs_bytepiece-0.2.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
rs_bytepiece-0.2.2-cp37-abi3-macosx_10_7_x86_64.whl CPython 3.7 abi3 macOS 10.7+ x86-64 Details for rs_bytepiece-0.2.2-cp37-abi3-macosx_10_7_x86_64.whl

Total release size: 10.8 MB

Release files / rs_bytepiece-0.2.2.tar.gz

Download URL rs_bytepiece-0.2.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
f86206004808f118d7581fe314387c6d0c45566cd34fda346c439c3392e912cd
BLAKE2b-256 checksum
How to use checksums
8a22b6bbac87677550e256e049e97b2cc4a75aa33bd12bb81ac7c4709d407178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.2.3

Release files / rs_bytepiece-0.2.2-cp37-abi3-win_amd64.whl

Download URL rs_bytepiece-0.2.2-cp37-abi3-win_amd64.whl
Size 3.8 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2e6a9f8b78bc24d4856b00240c82392ebe6008b110ba482e22c00f48f81b4e6c
BLAKE2b-256 checksum
How to use checksums
6230dea969abe55a7cf936c69b32b5ddda7eb09687300be9fa8923535da0d9f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.2.3

Release files / rs_bytepiece-0.2.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rs_bytepiece-0.2.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.5 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
2405a38e0a03985fabeb025eae65fcafcf5aae7c5f9b065c10cc17b72ae5e723
BLAKE2b-256 checksum
How to use checksums
14610a22cb90c845829383640d2a9ef17ab0286e9cef9189b7346194b5df2b72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.2.3

Release files / rs_bytepiece-0.2.2-cp37-abi3-macosx_10_7_x86_64.whl

Download URL rs_bytepiece-0.2.2-cp37-abi3-macosx_10_7_x86_64.whl
Size 2.3 MB
Tags CPython 3.7 abi3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
14338a8c8573df2ac4dc83567a58722d18984f678ce3426237d58e689288df1d
BLAKE2b-256 checksum
How to use checksums
4863809ac38242cf82098144777c8f82a94290d15aa04f9c45dbb57da7a78be8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.2.3

Security for rs-bytepiece 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page