Skip to content

Partial sync of codebase #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2025
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
15 changes: 12 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ edition = "2021"
rust-version = "1.57.0"

[lib]
name = "_tiktoken"
crate-type = ["cdylib"]
name = "tiktoken"
crate-type = ["cdylib", "rlib"]

[features]
default = []
python = [
"pyo3",
]

[dependencies]
pyo3 = { version = "0.22.2", default-features = false, features = ["extension-module", "macros"] }
pyo3 = { version = "0.22.2", default-features = false, features = [
"extension-module",
"macros",
], optional = true }

# tiktoken dependencies
fancy-regex = "0.13.0"
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name = "tiktoken"
version = "0.8.0"
description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models"
readme = "README.md"
license = {file = "LICENSE"}
authors = [{name = "Shantanu Jain"}, {email = "shantanu@openai.com"}]
license = { file = "LICENSE" }
authors = [{ name = "Shantanu Jain" }, { email = "shantanu@openai.com" }]
dependencies = ["regex>=2022.1.18", "requests>=2.26.0"]
optional-dependencies = {blobfile = ["blobfile>=2"]}
optional-dependencies = { blobfile = ["blobfile>=2"] }
requires-python = ">=3.9"

[project.urls]
Expand Down Expand Up @@ -43,3 +43,4 @@ test-command = "pytest {project}/tests --import-mode=append"
[[tool.cibuildwheel.overrides]]
select = "*linux_aarch64"
test-command = """python -c 'import tiktoken; enc = tiktoken.get_encoding("gpt2"); assert enc.encode("hello world") == [31373, 995]'"""

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Between our use of editable installs and wanting to use Rust for performance sensitive
# code, it makes sense to just always use --release
debug=False,
features=["python"],
)
],
package_data={"tiktoken": ["py.typed"]},
Expand Down
Loading
Loading