1.1.4 • Published 3 years ago

gpt-3-encoder v1.1.4

Weekly downloads
222
License
MIT
Repository
github
Last release
3 years ago

GPT-3-Encoder

Javascript BPE Encoder Decoder for GPT-2 / GPT-3

About

GPT-2 and GPT-3 use byte pair encoding to turn text into a series of integers to feed into the model. This is a javascript implementation of OpenAI's original python encoder/decoder which can be found here

Install with npm

npm install gpt-3-encoder

Usage

Compatible with Node >= 12

const {encode, decode} = require('gpt-3-encoder')

const str = 'This is an example sentence to try encoding out on!'
const encoded = encode(str)
console.log('Encoded this string looks like: ', encoded)

console.log('We can look at each token and what it represents')
for(let token of encoded){
  console.log({token, string: decode([token])})
}

const decoded = decode(encoded)
console.log('We can decode it back into:\n', decoded)
@infinitebrahmanuniverse/nolb-gp@everything-registry/sub-chunk-1781vue-i18n-resource-generatorwibuspectoraitestnishalaravel-gen-tool-zi18n-proinexushorni-clienthexo-gpt-taglib-model-ai@xapp/arachne-web-service@twinklepkg/chatgpt@twsc/code-review@transmart-next/core@transmart/core@zhzq/chat4c@terranlabs/ai-commitalphawaveagent-mimiragnaiagnaisticaiconfigaicodegenai-commitaigcai-helperawesomechat@ocis/code-review@notoriousgoat/sonnet-common@notoriousgoat/sonnet-types@polymath-ai/client@paulkinlan/openai-breadboard-kitgaia-commons-nodejs@stepsbyai/cli@suiz/ai-commit@suriyaruk/aicommit@taoya7/i18n-cliembeddingsflex-lib@acedatacloud/transmart-core@procoders/transmart-core@celp/celp-cli@bemoje/openai-api-clientchatgpt-officialchatgpt-api-clonechatgpt-hashkeychatgpt-optimized-officialchatgpt-text-davinci-003cts.aiauto-gpt-tsbranchcraftbotium-coach-workerdraftpilot@andriikhr/transmart-core@andriikhr/transmart-core-testlibbot-ai-checksubaitranslategpttreemd-jszd-chatgptyoutube-gptzf-vectrawarmaitech-chatgpt-apivectorizejsvectramimir-ainanoweb-llmopenai-nodejsopenai-throttleropenai-gpt-cost-estimatoropenai-price-estimatorsenselink-translate-coresearch-gptnini_pmnilgiricucumberpromptrixshoggothsllmgptsummarizergpt-persona@compensa/chatgpt@cognigy/cognigy-cli@dev-blinq/ai-qa-logic@dewebio/language-model@evertech/chatgpt-api-patched@focus-reactive/content-ai-sdk@relaycc/robot@ifnotnowwhen/promptr@hikae/humanify@rbxdiscord/chatgpt@rbxdiscord/openchat@microsoft/botbuilder-m365@minhchienwikipedia/ai-commit@rxap/plugin-gpt@iryu54/stack-monitor@glennjones/prompt@sbrow/tokenize@j-o-r/prompt
1.1.4

3 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago