Download src/model-precision.js from junaid-simamdigital/LFM2.5-VL-3B-WebGPU: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/LFM2.5-VL-3B-WebGPU/resolve/main/src/model-precision.js
- Command line
-
hf download hf://spaces/junaid-simamdigital/LFM2.5-VL-3B-WebGPU/src/model-precision.js
-
curl -L -o model-precision.js https://huggingface.co/spaces/junaid-simamdigital/LFM2.5-VL-3B-WebGPU/resolve/main/src/model-precision.js
673 Bytes
| export function selectEmbeddingPrecision(manifest, adapterFeatures = []) { | |
| const features = adapterFeatures instanceof Set ? adapterFeatures : new Set(adapterFeatures); | |
| const precision = features.has('shader-f16') ? 'fp16' : 'fp32'; | |
| const externalDataChunks = { ...manifest.runtime.externalDataChunks }; | |
| delete externalDataChunks['embed_tokens_fp16.onnx']; | |
| if (precision === 'fp16') externalDataChunks['embed_tokens_fp16.onnx'] = 1; | |
| return { | |
| precision, | |
| manifest: { | |
| ...manifest, | |
| runtime: { | |
| ...manifest.runtime, | |
| dtype: { ...manifest.runtime.dtype, embed_tokens: precision }, | |
| externalDataChunks, | |
| }, | |
| }, | |
| }; | |
| } | |