This repo is an example of how we can train a model in the browser with WebAssembly.
This demo showcases how to execute the training process in a web browser using a simple model. The project utilizes the Burn deep learning framework, WebGPU and WebAssembly.
npm install
To compile the Rust code into WebAssembly and build other essential files, execute the following script:
If your are on linux:
npm run lin-wasm
And If your are on Windows:
npm run win-wasm
Run the following command to initiate a dev web server on your local machine:
npm run dev
As of now, the WebGPU backend is compatible only with Chrome browsers running on macOS and Windows. The application will dynamically detect if WebGPU support is available and proceed accordingly.
In the main.js you can test by changing the hidden_size variable like 128, i recommand to use WebGpu.