File tree Expand file tree Collapse file tree 5 files changed +13
-11
lines changed
Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 99
1010# Python
1111.env
12+
13+ # macos
14+ .DS_Store
Original file line number Diff line number Diff line change @@ -16,10 +16,9 @@ release-darwin-%: test
1616 cp artifacts/darwin-$* /libtokenizers.darwin-$* .tar.gz artifacts/all/libtokenizers.darwin-$* .tar.gz
1717
1818release-linux-% : test
19- docker buildx build --platform linux/$* --build-arg= " DOCKER_TARGETPLATFORM=linux/ $* " - f release/Dockerfile . -t tokenizers.linux-$*
19+ docker buildx build --platform linux/$* -f release/Dockerfile . -t tokenizers.linux-$*
2020 mkdir -p artifacts/linux-$*
21- docker run -v $(PWD ) /artifacts/linux-$* :/mnt --entrypoint ls tokenizers.linux-$* /workspace/tokenizers/lib/linux
22- docker run -v $(PWD ) /artifacts/linux-$* :/mnt --entrypoint cp tokenizers.linux-$* /workspace/tokenizers/lib/linux/$* /libtokenizers.a /mnt/libtokenizers.a
21+ docker run -v $(PWD ) /artifacts/linux-$* :/mnt --entrypoint cp tokenizers.linux-$* /workspace/tokenizers/libtokenizers.a /mnt/libtokenizers.a
2322 cd artifacts/linux-$* && \
2423 tar -czf libtokenizers.linux-$* .tar.gz libtokenizers.a
2524 mkdir -p artifacts/all
@@ -31,10 +30,10 @@ release: release-darwin-aarch64 release-darwin-x86_64 release-linux-arm64 releas
3130 cp artifacts/all/libtokenizers.linux-x86_64.tar.gz artifacts/all/libtokenizers.linux-amd64.tar.gz
3231
3332test : build
34- @go test -ldflags= " -extldflags '-L./' " - v ./... -count=1
33+ @go test -v ./... -count=1
3534
3635clean :
3736 rm -rf libtokenizers.a target
3837
3938bazel-sync :
40- CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index
39+ CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ RUN curl -fsSL https://github.com/cohere-ai/tokenizers/releases/download/${VERSI
88COPY ./example .
99COPY ./test/data ./test/data
1010RUN go mod download
11- RUN mv ./libtokenizers.a /go/pkg/mod/github.com/cohere-ai /tokenizers@${VERSION}/lib/$(echo ${TARGETPLATFORM} | tr / -) /libtokenizers.a
11+ RUN mv ./libtokenizers.a /go/pkg/mod/github.com/daulet /tokenizers@${VERSION}/libtokenizers.a
1212# mounting Go cache won't work since we mutate it above
13- RUN go run main.go
13+ RUN go run main.go
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ COPY ./Cargo.lock ./Cargo.lock
1010RUN cargo build --release
1111
1212FROM golang:1.21 as builder-go
13- ARG DOCKER_TARGETPLATFORM
13+ ARG TARGETPLATFORM
1414WORKDIR /workspace
1515COPY ./release/go.mod .
1616COPY ./release/main.go .
@@ -19,6 +19,6 @@ COPY tokenizer.go ./tokenizers/
1919COPY tokenizers.h ./tokenizers/
2020COPY --from=builder-rust \
2121 /workspace/target/release/libtokenizers.a \
22- ./tokenizers/lib/${DOCKER_TARGETPLATFORM}/
22+ ./tokenizers/
2323COPY ./test/data ./test/data
24- RUN go run -ldflags= "-extldflags '-L./tokenizers/lib/${DOCKER_TARGETPLATFORM}'" .
24+ RUN go run .
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package tokenizers
33// TODO packaging: how do we build the rust lib for distribution?
44
55/*
6- #cgo LDFLAGS: -ltokenizers -ldl -lm -lstdc++
6+ #cgo LDFLAGS: ${SRCDIR}/libtokenizers.a -ldl -lm -lstdc++
77#include <stdlib.h>
88#include "tokenizers.h"
99*/
You can’t perform that action at this time.
0 commit comments