Instructions to use daveycodez/LFM3-1.7B-Web with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use daveycodez/LFM3-1.7B-Web with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'daveycodez/LFM3-1.7B-Web');
Remove the Reshape that duplicated the embedding at load
Browse files- README.md +1 -0
- onnx/model_q4f16.onnx +2 -2
README.md
CHANGED
|
@@ -26,6 +26,7 @@ This repository contains modified files. Compared with [onnx-community/LFM3-1.7B
|
|
| 26 |
|
| 27 |
- **Re-quantized weights:** all `MatMulNBits` weights were re-quantized from the fp16 ONNX model with GPTQ (4-bit, block size 128, with zero points). The tied embedding / LM head uses round-to-nearest 4-bit, block size 128, with a clip search.
|
| 28 |
- **Shorter rotary caches:** the cos/sin caches were cut from 262,144 to 16,384 positions. Sequences longer than 16,384 tokens fail with a clear error instead of running.
|
|
|
|
| 29 |
- **Calibration data:** about 36k tokens from the WikiText-2 training split plus chat replies generated by the fp16 model. No calibration text is included in the files.
|
| 30 |
|
| 31 |
`config.json`, the tokenizer files and the chat template are unchanged.
|
|
|
|
| 26 |
|
| 27 |
- **Re-quantized weights:** all `MatMulNBits` weights were re-quantized from the fp16 ONNX model with GPTQ (4-bit, block size 128, with zero points). The tied embedding / LM head uses round-to-nearest 4-bit, block size 128, with a clip search.
|
| 28 |
- **Shorter rotary caches:** the cos/sin caches were cut from 262,144 to 16,384 positions. Sequences longer than 16,384 tokens fail with a clear error instead of running.
|
| 29 |
+
- **No second copy of the embedding at load:** in the original graph, a `Reshape` feeds the shared embedding / LM-head weights to the LM head, which makes onnxruntime-web copy that 131 MB tensor while creating the session (about +390 MB of wasm heap and +131 MB of GPU memory). The graph now gives the LM head the same weights without the `Reshape`. Outputs are identical.
|
| 30 |
- **Calibration data:** about 36k tokens from the WikiText-2 training split plus chat replies generated by the fp16 model. No calibration text is included in the files.
|
| 31 |
|
| 32 |
`config.json`, the tokenizer files and the chat template are unchanged.
|
onnx/model_q4f16.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4bc2c0f1a3ebf6f32e8da253c1cf01d05b1b8f8100e5ad5ca647de80335882a
|
| 3 |
+
size 310650
|