-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tokenizers_srcdir_relative build tag to allow static library path
- Loading branch information
Showing
4 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,12 @@ Go bindings for the [HuggingFace Tokenizers](https://github.com/huggingface/toke | |
|
||
`make build` to build `libtokenizers.a` that you need to run your application that uses bindings. | ||
|
||
To use `libtokenizers.a` in your go application, either: | ||
* Place `libtokenizers.a` in /usr/lib/, and compile your app as usual with `go build`. | ||
* Place `libtokenizers.a` in the go source directory of the tokenizer module | ||
(e.g. /home/user/go/pkg/mod/github.com/daulet/[email protected]/), and compile with | ||
`go build -tags tokenizers_srcdir_relative`. | ||
|
||
### Using pre-built binaries | ||
|
||
Build your Go application using pre-built native binaries: `docker build --platform=linux/amd64 -f example/Dockerfile .` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# syntax=docker/dockerfile:1.3 | ||
|
||
FROM rust:1.71 as builder-rust | ||
FROM rust:1.74 as builder-rust | ||
ARG TARGETPLATFORM | ||
WORKDIR /workspace | ||
COPY ./src ./src | ||
|
@@ -16,5 +16,5 @@ COPY ./test/data ./test/data | |
RUN go mod download | ||
COPY --from=builder-rust \ | ||
/workspace/target/release/libtokenizers.a \ | ||
/go/pkg/mod/github.com/daulet/[email protected]/libtokenizers.a | ||
/usr/lib/libtokenizers.a | ||
RUN go run main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters