diff --git a/docs/blog/240321_hugot/240321_hugot.md b/docs/blog/240321_hugot/240321_hugot.md new file mode 100644 index 0000000..2b50aa7 --- /dev/null +++ b/docs/blog/240321_hugot/240321_hugot.md @@ -0,0 +1,33 @@ +# Hugot + +https://github.com/knights-analytics/hugot + +> The goal of this library is to provide an easy, scalable, and hassle-free way to run huggingface transformer pipelines in golang applications. + +Let's see how easy it is (on Mac). + +## Installation + +1. Getting the tokenizers + +``` +git clone https://github.com/Knights-Analytics/tokenizers -b main && \ +cd tokenizers && \ +cargo build --release +mv target/release/libtokenizers.a /usr/lib/libtokenizers.a +``` + +but rust was not updated, so I ran `rustup update` and then the above commands. But instead got `mv: fastcopy: open() failed (to): /usr/lib/libtokenizers.a: Operation not permitted`. This is because of SIP (System Integrity Protection) on Mac. So, let's try to instead move it to `/usr/local/lib`. + +At the same time, I realized I just ran the `cargo build --release` command, but I'm not sure if that built it for the right architecture. So, I'll instead download the pre-built binary from the releases page of [github.com/daulet/tokenizers](https://github.com/daulet/tokenizers/releases). I downloaded the ` libtokenizers.darwin-arm64.tar.gz` for my M2 Max, untared it, and moved it with (which I needed `sudo` for). + +2. Getting the ONNX runtime + +I downloaded the `onnxruntime-osx-arm64-1.17.1.tgz` from the [ONNX runtime releases page](https://github.com/microsoft/onnxruntime/releases), untared it, and moved `libonnxruntime.1.17.1.dylib` to `/usr/local/lib` and renamed it to `libonnxruntime.dylib`. + +```bash +sudo cp ~/Downloads/onnxruntime-osx-arm64-1.17.1/lib/libonnxruntime.1.17.1.dylib /usr/local/lib/libonnxruntime.dylib +``` + + +https://www.izumanetworks.com/blog/build-docker-on-apple-m/ \ No newline at end of file