Skip to content

Commit e30b283

Browse files
committed
Update package.json version to 1.3.2 and include Buffer for browsers
1 parent 775b030 commit e30b283

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sctg/sentencepiece-js",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Sentencepiece tokenization for natural language processing, JS version.",
55
"main": "dist/index.js",
66
"type": "module",

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { SentencePieceProcessor, cleanText } from "./sentencePieceProcessor";
22
import { llama_3_1_tokeniser_b64 } from "./llama_3_1_tokeniser_model";
33
import { smart_b64 } from "./smart";
44
import { clean_30k_b64 } from "./clean_30k";
5+
import { Buffer as _Buffer } from "buffer";
56

67
export { SentencePieceProcessor, cleanText, llama_3_1_tokeniser_b64, clean_30k_b64, smart_b64 };
7-
export default { SentencePieceProcessor, cleanText };
8+
export default { SentencePieceProcessor, cleanText };``
9+
10+
if (typeof globalThis.Buffer === 'undefined') {
11+
globalThis.Buffer = _Buffer;
12+
}

0 commit comments

Comments
 (0)