Skip to content

Commit f1f18d3

Browse files
committed
Make tokenizer version configurable from Dockerfile
Extracts TOKENIZER_VERSION from the Dockerfile and uses it in the download-tokenizer target. This allows the Makefile to automatically use the correct tokenizer version specified in the Dockerfile, improving maintainability and consistency. Signed-off-by: Sergey Marunich <[email protected]>
1 parent 2097aeb commit f1f18d3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ help: ## Print help
3939
LDFLAGS ?= -extldflags '-L$(shell pwd)/lib'
4040
CGO_ENABLED=1
4141
TOKENIZER_LIB = lib/libtokenizers.a
42+
# Extract TOKENIZER_VERSION from Dockerfile
43+
TOKENIZER_VERSION := $(shell grep '^ARG TOKENIZER_VERSION=' Dockerfile | cut -d'=' -f2)
4244

4345
.PHONY: download-tokenizer
4446
download-tokenizer: $(TOKENIZER_LIB)
4547
$(TOKENIZER_LIB):
4648
## Download the HuggingFace tokenizer bindings.
47-
@echo "Downloading HuggingFace tokenizer bindings..."
49+
@echo "Downloading HuggingFace tokenizer bindings for version $(TOKENIZER_VERSION)..."
4850
mkdir -p lib
49-
curl -L https://github.com/daulet/tokenizers/releases/download/v1.22.1/libtokenizers.$(TARGETOS)-$(TARGETARCH).tar.gz | tar -xz -C lib
51+
curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TARGETARCH).tar.gz | tar -xz -C lib
5052
ranlib lib/*.a
5153

5254
##@ Development
@@ -224,4 +226,4 @@ download-zmq: ## Install ZMQ dependencies based on OS/ARCH
224226
exit 1; \
225227
fi; \
226228
echo "✅ ZMQ dependencies installed."; \
227-
fi
229+
fi

0 commit comments

Comments
 (0)