dqbd / tiktoken

JS port and JS/WASM bindings for openai/tiktoken
MIT License
649 stars 49 forks source link

Does this work in browser ? #47

Closed snwfdhmp closed 11 months ago

snwfdhmp commented 1 year ago

I'm very interested in bringing this feature to webbrowsers, did you test it in browser and does it work ?

dqbd commented 1 year ago

Hello @snwfdhmp!

Browser should be well supported both in js-tiktoken and tiktoken, albeit the latter does require either a proper bundle configuration (see README.md of tiktoken) or fetching and instantiating WASM binary files manually.

An example of browser usage can be seen in https://github.com/dqbd/tiktokenizer

dqbd commented 11 months ago

Closing this issue for now, feel free to reopen if needed!