tinygrad/examples/tinychat/tinychat-browser
chenyu d57d24c7d4
Buffer.as_buffer -> Buffer.as_memoryview [pr] (#14535)
it casts to memoryview. also inline the as_typed_buffer checks to Tensor._data
2026-02-04 11:31:11 -05:00
..
.gitignore tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
compile.py Buffer.as_buffer -> Buffer.as_memoryview [pr] (#14535) 2026-02-04 11:31:11 -05:00
compile_wasm.sh tinychat in browser, Part 2: model export (#9274) 2025-03-04 15:53:30 +08:00
index.css tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
index.html tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
index.js tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
make_tiktoken_js.sh tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
README.md tinychat in browser, Part 2: model export (#9274) 2025-03-04 15:53:30 +08:00
tiktoken-export.js tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
webpack.config.js tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00
worker.js tinychat in browser, Part 3: browser app (#9276) 2025-03-07 15:07:33 +08:00

How to build and run tinychat in browser (WebGPU and WASM)

  • PYTHONPATH=. python examples/tinychat/tinychat-browser/compile.py
  • ./examples/tinychat/tinychat-browser/compile_wasm.sh
    • Prerequisite: install emscripten. This script looks for ~/emsdk/emsdk_env.sh, adjust this based on your installation.
  • ./examples/tinychat/tinychat-browser/make_tiktoken_js.sh
    • Prerequisite: install npm, webpack.
  • cd examples/tinychat && python -m http.server 7776
  • In browser: open either localhost:7776/tinychat-browser (WebGPU), or localhost:7776/tinychat-browser/?backend=wasm (WASM)