|
4 | 4 | [](https://goreportcard.com/report/github.com/knights-analytics/hugot) |
5 | 5 | [](https://coveralls.io/github/knights-analytics/hugot?branch=main) |
6 | 6 |
|
| 7 | +<img src="./hug-gopher.webp" width="300"> |
| 8 | + |
7 | 9 | ## What |
8 | 10 |
|
9 | 11 | The goal of this library is to provide an easy, scalable, and hassle-free way to run huggingface transformer pipelines in golang applications. It is built on the following principles: |
@@ -61,7 +63,8 @@ On different distros (e.g. Ubuntu), you should be able to install the equivalent |
61 | 63 | ## Limitations |
62 | 64 |
|
63 | 65 | Apart from the fact that only the aforementioned pipelines are currently implemented, the current limitations are: |
64 | | - - the library and cli are only built/tested on amd64-linux |
| 66 | + |
| 67 | +- the library and cli are only built/tested on amd64-linux currently. |
65 | 68 |
|
66 | 69 | Pipelines are also tested on specifically NLP use cases. In particular, we use the following models for testing: |
67 | 70 | - feature extraction: all-MiniLM-L6-v2 |
@@ -160,6 +163,8 @@ See also hugot_test.go for further examples. |
160 | 163 |
|
161 | 164 | ### Use it as a cli: Huggingface 🤗 pipelines from the command line |
162 | 165 |
|
| 166 | +Note: the cli is currently only built and tested on amd64-linux. |
| 167 | + |
163 | 168 | With hugot you don't need python, pytorch, or even go to run huggingface transformers. Simply install the hugot cli (alpha): |
164 | 169 |
|
165 | 170 | ``` |
@@ -225,55 +230,4 @@ For GPU the config above also applies. We are still testing the optimum GPU conf |
225 | 230 |
|
226 | 231 | ## Contributing |
227 | 232 |
|
228 | | -### Development environment |
229 | | - |
230 | | -The easiest way to contribute to hugot is by developing inside a docker container that has the tokenizer and onnxruntime libraries. |
231 | | -From the source folder, it should be as easy as: |
232 | | - |
233 | | -```bash |
234 | | -make start-dev-container |
235 | | -``` |
236 | | - |
237 | | -which will download the test models, build the test container, and launch it (see [compose-dev](./compose-dev.yaml)), mounting the source code at /home/testuser/repositories/hugot. Then you can attach to the container with e.g. vscode remote extension as testuser. The vscode attached container configuration file can be set to: |
238 | | - |
239 | | -``` |
240 | | -{ |
241 | | - "remoteUser": "testuser", |
242 | | - "workspaceFolder": "/home/testuser/repositories/hugot", |
243 | | - "extensions": [ |
244 | | - "bierner.markdown-preview-github-styles", |
245 | | - "golang.go", |
246 | | - "ms-azuretools.vscode-docker" |
247 | | - ], |
248 | | - "remoteEnv": {"GOPATH": "/home/testuser/go"} |
249 | | -} |
250 | | -``` |
251 | | - |
252 | | -Once you're done, you can tear the container down with: |
253 | | - |
254 | | -```bash |
255 | | -make stop-dev-container |
256 | | -``` |
257 | | - |
258 | | -Alternatively, you can use your IDE devcontainer support, and point it to the [Dockerfile](./Dockerfile). |
259 | | - |
260 | | -If you prefer to develop on bare metal, you will need to download the tokenizers.a to /usr/lib/tokenizers.a and onnxruntime.so to /usr/lib/onnxruntime.so. |
261 | | - |
262 | | -### Run the tests |
263 | | - |
264 | | -The full test suite can be run as follows. From the source folder: |
265 | | - |
266 | | -```bash |
267 | | -make clean run-tests |
268 | | -``` |
269 | | - |
270 | | -This will build a test image and run all tests in a container. A testTarget folder will appear in the source directory with the test results. |
271 | | - |
272 | | -### Contribution process |
273 | | - |
274 | | -1. create or find an issue for your contribution |
275 | | -2. fork and develop |
276 | | -3. add tests and make sure the full test suite passes and test coverage does not dip below 80% |
277 | | -4. create a MR linking to the relevant issue |
278 | | - |
279 | | -Thank you for contributing to hugot! |
| 233 | +If you would like to contribute to Hugot, please see the (contribution guidelines)[contrib.MD]. |
0 commit comments