Coder Social home page Coder Social logo

vitaly-z / rwkv-v4-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from josephrocca/rwkv-v4-web

0.0 0.0 0.0 1.88 MB

BlinkDL's RWKV-v4 running in the browser

Home Page: https://josephrocca.github.io/rwkv-v4-web/demo

License: MIT License

JavaScript 2.33% Jupyter Notebook 97.67%

rwkv-v4-web's Introduction

RWKV-v4 running in the browser

BlinkDL's RWKV-v4 running in the browser. Thanks to @AXKuhta for their work in getting this working! And thanks to @johnflux for multinomial sampling support.

See the @BlinkDL/RWKV-LM repo for more info on RWKV-LM.

Local Development

Serving

Note that we require the html file is served with:

Cross-Origin-Embedder-Policy: require-corp // or: credentialless
Cross-Origin-Opener-Policy: same-origin

Unfortunately this means that we can't use a lot of the simple ways of serving a local html file. None of vscode live-server extensions work because at time of writing they don't support custom headers.

One way is:

# First install npm.  On windows you can use https://github.com/coreybutler/nvm-windows/releases then restart vscode
nvm install 19 && nvm use 19 # If you don't have npm yet
npx servez --shared-array-buffers --local demo 

Then open http://localhost:8080/

Loading the model

If you hit the huggingface endpoint too often, it will start failing your downloads.

I recommend downloading the onnx file (e.g. https://huggingface.co/rocca/rwkv-4-pile-web/resolve/main/169m/rwkv-4-pile-169m-uint8.onnx) into the demo/ folder, then using the load local copy button.

Running tests

Run tests with:

npx jest

TODO:

rwkv-v4-web's People

Contributors

josephrocca avatar johnflux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.