Skip to content

gguf-py: Make sentencepiece optional #14200

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 3 commits into from
Jun 19, 2025

Conversation

Ahajha
Copy link
Contributor

@Ahajha Ahajha commented Jun 15, 2025

Sentencepiece has not had a new release in over a year, and users are running into easily fixable install issues like CMake minimum versions, missing headers, and missing wheels for newer python versions. See recent issues: https://github.com/google/sentencepiece/issues, like this one for example: google/sentencepiece#1113

Sentencepiece is only actually used if users are already using it, so it seems pointless to depend on it directly. This updates the support to raise an error if sentencepiece isn't installed.

@github-actions github-actions bot added the python python script changes label Jun 15, 2025
@Ahajha Ahajha changed the title Make sentencepiece optional gguf-py: Make sentencepiece optional Jun 15, 2025
@ngxson ngxson requested a review from compilade June 15, 2025 21:36
@ownia
Copy link
Contributor

ownia commented Jun 16, 2025

Are there alternatives to sentencepiece? If it is no longer maintained, it will always be broken. (I met this issue since Python 3.13)

@Ahajha
Copy link
Contributor Author

Ahajha commented Jun 16, 2025

Not that I'm aware of, but I'm not that knowledgeable about these things. I'm coming at this from a pure packaging perspective.

Copy link
Collaborator

@compilade compilade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sentencepiece is also used in convert_hf_to_gguf.py, might be relevant to add similar changes in a follow-up PR, or here.

@compilade compilade requested a review from CISC June 18, 2025 22:26
@CISC CISC merged commit 381174b into ggml-org:master Jun 19, 2025
4 checks passed
@Ahajha Ahajha deleted the optional-sentencepiece branch June 19, 2025 14:04
modularbot pushed a commit to modular/modular that referenced this pull request Jun 20, 2025
ggml-org/llama.cpp#14200
mlc-ai/xgrammar#337

gguf immediately released a new version, waiting on xgrammar. In the
meantime though, bump gguf and remove the explicit sentencepiece
dependency, it isn't used anywhere.

This should automatically propagate up towards users, no need to bump
minimum required versions.

MODULAR_ORIG_COMMIT_REV_ID: 27aa8a6ece6f56d253875294f8ae9988eecc8cc1
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Jun 20, 2025
* mamba2-sync: (24 commits)
sync : ggml
Add `ggml_roll` (ggml/1274)
docs : fix the link to llama.h (ggml-org#14293)
CUDA: add conv_2d_transpose (ggml-org#14287)
lint : remove trailing whitepace (ggml-org#14304)
vocab : prevent tokenizer overflow (ggml-org#14301)
sycl: add usage of enqueue_functions extension (ggml-org#14244)
Implement GGML_CPU_ALL_VARIANTS for PowerPC (ggml-org#14286)
llama : improve sep token handling (ggml-org#14272)
cuda : synchronize graph capture and cublas handle destruction (ggml-org#14288)
ggml : fix repack work size for mul_mat_id (ggml-org#14292)
ggml: Update KleidiAI to v1.9.0 (ggml-org#14277)
model : more uniform output id handling (ggml-org#14275)
ubatch : new splitting logic (ggml-org#14217)
CUDA: add conv_2d_dw (ggml-org#14265)
ggml-cpu : remove unnecesary arm feature detection (ggml-org#14281)
gguf-py : make sentencepiece optional (ggml-org#14200)
server : add server parameters for draft model cache type (ggml-org#13782)
build : suppress gcc15 compile warnings (ggml-org#14261)
sycl: Cleanup codepaths in Get Rows in sycl backend (ggml-org#14215)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python python script changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants