https://github.com/rockwotj/tract-tests
https://github.com/rockwotj/tract-tests
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rockwotj/tract-tests
- Owner: rockwotj
- Created: 2023-12-13T19:32:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-15T03:29:36.000Z (over 1 year ago)
- Last Synced: 2023-12-15T22:03:53.254Z (over 1 year ago)
- Language: Rust
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BERT with tract
An example of running BERT QA with tract.
The code here is mostly ported from the iOS example of Bert QA in the tensorflow lite repo: https://github.com/tensorflow/examples/tree/master/lite/examples/bert_qa/ios
Download the mobile bert model in tflite format via:
```
curl -SLo mobilebert.tflite https://tfhub.dev/tensorflow/lite-model/mobilebert/1/metadata/1?lite-format=tflite
```Then the tflite model needs to be converted to ONNX:
```
python -m tf2onnx.convert --opset 16 --tflite mobilebert.tflite --output mobilebert.onnx
```Then this example can be ran with `cargo run --release`.
The differences with running the code in tract vs tflite can be found in `differences.txt`