Update README.md
Browse files
README.md
CHANGED
@@ -5,4 +5,19 @@ language:
|
|
5 |
pipeline_tag: summarization
|
6 |
library_name: transformers.js
|
7 |
---
|
8 |
-
https://huggingface.co/JustinDu/BARTxiv with ONNX weights to be compatible with Transformers.js.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
pipeline_tag: summarization
|
6 |
library_name: transformers.js
|
7 |
---
|
8 |
+
https://huggingface.co/JustinDu/BARTxiv with ONNX weights to be compatible with Transformers.js.
|
9 |
+
|
10 |
+
## Steps to get ONNX quantized weights
|
11 |
+
1. Use optimum-cli to convert the PyTorch weights to ONNX format.
|
12 |
+
|
13 |
+
```bash
|
14 |
+
optimum-cli export onnx --model JustinDu/BARTxiv BARTxiv_onnx
|
15 |
+
```
|
16 |
+
|
17 |
+
2. Use the `quantize` script in the Transformers.js repo to quantize the ONNX weights.
|
18 |
+
|
19 |
+
```bash
|
20 |
+
python -m scripts.quantize --input_folder BARTxiv_onnx --output_folder BARTxiv_onnx/onnx
|
21 |
+
```
|
22 |
+
|
23 |
+
Move the `.onnx` files in the `BARTxiv_onnx` folder to `BARTxiv_onnx/onnx` (these are the FP32 weights).
|