Skip to content

Commit

Permalink
add support for darwin-arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Daulet Zhanguzin committed May 3, 2023
1 parent 1307b14 commit b07032a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ build:
build-example:
@docker build -f ./example/Dockerfile . -t tokenizers-example

release-darwin-arm64:
cd lib && cargo build --release --target aarch64-apple-darwin
mkdir -p release/darwin-arm64
cp lib/target/aarch64-apple-darwin/release/libtokenizers.a release/darwin-arm64/libtokenizers.a
cd release/darwin-arm64 && \
tar -czf libtokenizers.darwin-arm64.tar.gz libtokenizers.a

release-linux-%:
docker buildx build --platform linux/$* -f example/Dockerfile . -t tokenizers.linux-$*
mkdir -p release/linux-$*
docker run -v $(PWD)/release/linux-$*:/mnt --entrypoint cp tokenizers.linux-$* /workspace/libtokenizers.a /mnt/libtokenizers.a
mkdir -p release/output
tar -czf release/output/libtokenizers.linux-$*.tar.gz release/linux-$*/libtokenizers.a
cd release/linux-$* && \
tar -czf libtokenizers.linux-$*.tar.gz libtokenizers.a

test: build
@go test -v ./... -count=1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Go bindings for the [HuggingFace Tokenizers](https://github.com/huggingface/toke

### Using pre-built binaries

* [darwin-arm64](https://github.com/daulet/tokenizers/releases/latest/download/libtokenizers.darwin-arm64.tar.gz)
* [linux-arm64](https://github.com/daulet/tokenizers/releases/latest/download/libtokenizers.linux-arm64.tar.gz)
* [linux-amd64](https://github.com/daulet/tokenizers/releases/latest/download/libtokenizers.linux-amd64.tar.gz)

Expand Down

0 comments on commit b07032a

Please sign in to comment.