Skip to content

Commit 57683ca

Browse files
committed
makefile extracts tokenizer version from dockerfile
Signed-off-by: Maroon Ayoub <[email protected]>
1 parent 824cfaa commit 57683ca

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ COPY . .
3939

4040
# HuggingFace tokenizer bindings
4141
RUN mkdir -p lib
42-
RUN curl -L https://github.com/daulet/tokenizers/releases/download/v1.22.1/libtokenizers.${TARGETOS}-${TARGETARCH}.tar.gz | tar -xz -C lib
42+
ARG RELEASE_VERSION=1.22.1
43+
RUN curl -L https://github.com/daulet/tokenizers/releases/download/${RELEASE_VERSION}/libtokenizers.${TARGETOS}-${TARGETARCH}.tar.gz | tar -xz -C lib
4344
RUN ranlib lib/*.a
4445

4546
# Build

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ help: ## Print help
2727
LDFLAGS ?= -extldflags '-L$(shell pwd)/lib'
2828
CGO_ENABLED=1
2929
TOKENIZER_LIB = lib/libtokenizers.a
30-
TOKENIZER_RELEASE = v1.22.1
30+
# Extract RELEASE_VERSION from Dockerfile
31+
TOKENIZER_VERSION := $(shell grep '^ARG RELEASE_VERSION=' Dockerfile | cut -d'=' -f2)
3132

3233
.PHONY: download-tokenizer
3334
download-tokenizer: $(TOKENIZER_LIB)
3435
$(TOKENIZER_LIB):
3536
## Download the HuggingFace tokenizer bindings.
36-
@echo "Downloading HuggingFace tokenizer bindings..."
37+
@echo "Downloading HuggingFace tokenizer bindings for version v$(TOKENIZER_VERSION)..."
3738
mkdir -p lib
38-
curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_RELEASE)/libtokenizers.$(TARGETOS)-$(TARGETARCH).tar.gz | tar -xz -C lib
39+
curl -L https://github.com/daulet/tokenizers/releases/download/v$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TARGETARCH).tar.gz | tar -xz -C lib
3940
ranlib lib/*.a
4041

4142
##@ Precommit code checks --

examples/kv_cache_index/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ func setupKVCacheIndexer(ctx context.Context) (*kvcache.Indexer, error) {
9494
return nil, err
9595
}
9696

97+
config.TokenProcessorConfig.BlockSize = 256
98+
9799
kvCacheIndexer, err := kvcache.NewKVCacheIndexer(ctx, config)
98100
if err != nil {
99101
return nil, err

examples/kv_events/offline/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ func getKVCacheIndexerConfig() *kvcache.Config {
4646
config.TokenizersPoolConfig.HuggingFaceToken = huggingFaceToken
4747
}
4848

49+
config.TokenProcessorConfig.BlockSize = 256
50+
4951
return config
5052
}
5153

0 commit comments

Comments
 (0)