{"name":"gpt-3-encoder","version":"1.1.4","description":"Javascript BPE Encoder Decoder for GPT-2 / GPT-3","main":"index.js","types":"./index.d.ts","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+https://github.com/AIDungeon/GPT-3-Encoder.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/AIDungeon/GPT-3-Encoder/issues"},"homepage":"https://github.com/AIDungeon/GPT-3-Encoder#readme","devDependencies":{"jest":"^26.4.2"},"gitHead":"9df47fc655a062d16751067326a60f16b86ce001","_id":"gpt-3-encoder@1.1.4","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-fSQRePV+HUAhCn7+7HL7lNIXNm6eaFWFbNLOOGtmSJ0qJycyQvj60OvRlH7mee8xAMjBDNRdMXlMwjAbMTDjkg==","shasum":"d6cdaacf5824857e133b6065247c757fc7e4fa72","tarball":"http://registry-npm.ywwl.com/gpt-3-encoder/download/gpt-3-encoder-1.1.4.tgz","fileCount":8,"unpackedSize":1505408,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbuNMDvWjhVVrIEtz33W7uX1qDXZ58W5MyUgcZegsl+AiEAi8EVrghMnRSz+ze/+3ddQOL6KRnOMwhVo0JJMv3vNF8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyEOJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoixQ/+KC91OmnCHvu8E3YwI9Qvs4A53x79AOaI2QPqXlqmTHFG3BGO\r\nqwMZuz+2gDKk1xqDC016fH7bgAWrglhV/cCZWrnRjGSE1ZejNb3vgZq5LYMS\r\nQ+jWf+lxSyuwEUypK1AxKPF+xI09M6I69lalJGJQ6LCs0vm1lLsbw9qrPmRw\r\nzmMl13hI8kq/VSZkzF32+7cFfDS55HX7TtRnPZ4lOWT21SfDuc0yxy4WNzzl\r\naqwF4evz7U6MC7kYJxk/rPoCW15nYzjbUpHMzr3KE5qrqfi4lM39GfOJyute\r\nyCvg6FXJzPf8w9JXO18czszk29RDpDe3igpCnNAWR1AdB5VsBBFnRpZHwy6o\r\ni4z9eTktqK85DNjYsjwLO/xsAlNVKkaUEIx3kSGdqjeQ/olg6LI49HZd2/hP\r\nfShvRnTunYaSGRkOzTFj7jO5gti6sdx7+KNyroMSEWpqk7QEuUimdLGZ6qbD\r\nqhuJ4Znra9fE+m/up82CKwEhxKorh4WnHbs1weUxW+rvC1PphtHZBoztElM1\r\njQVOfDN4iU9I4lfJpdHpruCyZSMKKn3MoTOojSFmgUUodRfEeqs1aL4LlyHJ\r\ntI/phcizSql3L9zSOn6knCU76LXE+eaCF8moPhTNMvh0IMUX7fo+CNR21qTG\r\nMlgUHrwD0s66zm6AcloXMcW6Si5pua/KBUY=\r\n=MxEu\r\n-----END PGP SIGNATURE-----\r\n","size":559221,"noattachment":false,"key":"/gpt-3-encoder/-/gpt-3-encoder-1.1.4.tgz"},"_npmUser":{"name":"nickwalton00","email":"tech@latitude.io"},"directories":{},"maintainers":[{"name":"nickwalton00","email":"tech@latitude.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gpt-3-encoder_1.1.4_1674068872877_0.429382806357244"},"_hasShrinkwrap":false,"readme":"# GPT-3-Encoder\nJavascript BPE Encoder Decoder for GPT-2 / GPT-3\n\n## About\nGPT-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](https://github.com/openai/gpt-2)\n\n## Install with npm\n\n```\nnpm install gpt-3-encoder\n```\n\n## Usage\n\nCompatible with Node >= 12\n\n```js\nconst {encode, decode} = require('gpt-3-encoder')\n\nconst str = 'This is an example sentence to try encoding out on!'\nconst encoded = encode(str)\nconsole.log('Encoded this string looks like: ', encoded)\n\nconsole.log('We can look at each token and what it represents')\nfor(let token of encoded){\n  console.log({token, string: decode([token])})\n}\n\nconst decoded = decode(encoded)\nconsole.log('We can decode it back into:\\n', decoded)\n\n```\n\n\n","publish_time":1674068873080,"_cnpm_publish_time":1674068873080,"dist-tags":{"latest":"1.1.4"}}