-
Book Overview & Buying
-
Table Of Contents
Blazor WebAssembly by Example - Third Edition
By :
To run bge‑micro‑v2 inference in your Blazor WebAssembly app, it takes three key components working together:
model.onnx + vocab.txt)onnx.js)The ONNX model files contain the trained model and the vocabulary (30,522 tokens). To add the ONNX model, create a folder in the wwwroot folder called models and copy the model.onnx and the vocab.txt files into it.
The ONNX Runtime Web is a JavaScript library that enables you to run ML models directly in the browser. To add ONNX Runtime Web to your Blazor WebAssembly app, add the following markup to the bottom of the head section of the index.html file.
<script
src="https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js">
</script>
The JavaScript wrapper includes the JavaScript functions needed to work with the ONNX model. To add the JavaScript wrapper, create a folder in the...