Skip to content

Commit

Permalink
Export from index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kafkas committed Oct 31, 2020
1 parent de921e5 commit 392263a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
3 changes: 0 additions & 3 deletions Encoder.d.ts

This file was deleted.

5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module "gpt-3-encoder" {
export function encode(text: string): string[];

export function decode(tokens: string[]): string;
}
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { encode, decode } = require("./Encoder");

module.exports = {
encode,
decode,
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "gpt-3-encoder",
"version": "1.1.3",
"description": "Javascript BPE Encoder Decoder for GPT-2 / GPT-3",
"main": "Encoder.js",
"types": "Encoder.d.ts",
"main": "index.js",
"types": "index.d.ts",
"files": [
"encoder.json",
"vocab.bpe"
Expand Down

0 comments on commit 392263a

Please sign in to comment.