Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gpt-3-encoder

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpt-3-encoder - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

example.js

@@ -10,6 +10,6 @@ const {encode, decode} = require('./encoder.js')

for(let token of encoded){
console.log('Token: ', token, ' String: ', encode([token]))
console.log({token, string: decode([token])})
}
const decoded = decode(encoded)
console.log('We can decode it back into ', decoded)
console.log('We can decode it back into:\n', decoded)
{
"name": "gpt-3-encoder",
"version": "1.0.0",
"version": "1.0.1",
"description": "Javascript BPE Encoder Decoder for GPT-2 / GPT-3",

@@ -11,3 +11,3 @@ "main": "encoder.js",

"type": "git",
"url": "git+https://github.com/AIDungeon/Javascript-GPT-3-Encoder.git"
"url": "git+https://github.com/AIDungeon/GPT-3-Encoder.git"
},

@@ -17,5 +17,5 @@ "author": "",

"bugs": {
"url": "https://github.com/AIDungeon/Javascript-GPT-3-Encoder/issues"
"url": "https://github.com/AIDungeon/GPT-3-Encoder/issues"
},
"homepage": "https://github.com/AIDungeon/Javascript-GPT-3-Encoder#readme"
"homepage": "https://github.com/AIDungeon/GPT-3-Encoder#readme"
}

@@ -1,4 +0,12 @@

# Javascript-GPT-3-Encoder
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 serires 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)
## How to Use
1. [Install Node](https://nodejs.org/en/download/package-manager/)
2. `clone https://github.com/AIDungeon/GPT-3-Encoder.git`
3. `cd GPT-3-Encoder.git`
4. `npm install`
5. `node example.js`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc