Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ jobs:
# cibuildwheel builds linux wheels inside a manylinux container
# it also takes care of procuring the correct python version for us
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [39, 310, 311, 312, 313]
python-version: [39, 310, 311, 312, 313, 313t, 314, 314t]

steps:
- uses: actions/checkout@v4

- uses: pypa/cibuildwheel@v2.22.0
- uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_BUILD: "cp${{ matrix.python-version}}-*"
CIBW_ENABLE: cpython-freethreading

- uses: actions/upload-artifact@v4
with:
Expand All @@ -39,19 +40,20 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-24.04-arm]
python-version: [39, 310, 311, 312, 313]
python-version: [39, 310, 311, 312, 313, 313t, 314, 314t]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_BUILD: "cp${{ matrix.python-version}}-*"
CIBW_ARCHS: aarch64
CIBW_BUILD_VERBOSITY: 3
# https://github.com/rust-lang/cargo/issues/10583
CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI=true
CIBW_ENABLE: cpython-freethreading

- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl std::error::Error for EncodeError {}

const MAX_NUM_THREADS: usize = 128;

#[cfg_attr(feature = "python", pyclass)]
#[cfg_attr(feature = "python", pyclass(frozen))]
#[derive(Clone)]
pub struct CoreBPE {
encoder: HashMap<Vec<u8>, Rank>,
Expand Down
4 changes: 2 additions & 2 deletions src/py.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl CoreBPE {
}
}

#[pyclass]
#[pyclass(frozen)]
struct TiktokenBuffer {
tokens: Vec<Rank>,
}
Expand Down Expand Up @@ -248,7 +248,7 @@ impl TiktokenBuffer {
}
}

#[pymodule]
#[pymodule(gil_used = false)]
fn _tiktoken(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
m.add_class::<CoreBPE>()?;
Ok(())
Expand Down
Loading