llama-stack-mirror/llama_stack/models/llama/llama4
Sébastien Han b45cc42202
chore: remove usage of load_tiktoken_bpe
The `load_tiktoken_bpe()` function depends on blobfile to load
tokenizer.model files. However, blobfile brings in pycryptodomex, which
is primarily used for JWT signing in GCP - functionality we don’t
require, as we always load tokenizers from local files. pycryptodomex
implements its own cryptographic primitives, which are known to be
problematic and insecure. While blobfile could potentially switch to the
more secure PyCA cryptography library, the project appears inactive, so
this transition may not happen soon. Fortunately, `load_tiktoken_bpe()`
is a simple function that just reads a BPE file and returns a dictionary
mapping byte sequences to their mergeable ranks. It’s straightforward
enough for us to implement ourselves.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-05-27 20:47:06 +02:00
..
prompt_templates fix: llama4 tool use prompt fix (#2103) 2025-05-06 22:18:31 -07:00
quantization chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
vision chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
__init__.py feat: introduce llama4 support (#1877) 2025-04-05 11:53:35 -07:00
args.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
chat_format.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
datatypes.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
ffn.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
generation.py chore: make cprint write to stderr (#2250) 2025-05-24 23:39:57 -07:00
model.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
moe.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
preprocess.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
prompt_format.md fix: llama4 tool use prompt fix (#2103) 2025-05-06 22:18:31 -07:00
prompts.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
tokenizer.model feat(pre-commit): enhance pre-commit hooks with additional checks (#2014) 2025-04-30 11:35:49 -07:00
tokenizer.py chore: remove usage of load_tiktoken_bpe 2025-05-27 20:47:06 +02:00