@lenml/tokenizers
Advanced tools
| import { AutoTokenizer, PreTrainedTokenizer } from "./tokenizers/tokenizers"; | ||
| // NOTE: Set this to turn off the warning of claude tokenizer | ||
| // @ts-ignore | ||
| AutoTokenizer.TOKENIZER_CLASS_MAPPING.ClaudeTokenizer = PreTrainedTokenizer; |
+1
-1
| { | ||
| "name": "@lenml/tokenizers", | ||
| "version": "1.0.9", | ||
| "version": "1.1.1", | ||
| "description": "a lightweight no-dependency fork of transformers.js (only tokenizers)", | ||
@@ -5,0 +5,0 @@ "source": "src/main.ts", |
+1
-0
@@ -0,3 +1,4 @@ | ||
| import "./prepatch"; | ||
| export * from "./TokenizerLoader"; | ||
| export * as tokenizers from "./tokenizers/tokenizers"; | ||
| export * from "./types"; |
@@ -53,2 +53,6 @@ /** | ||
| constructor(...args) { | ||
| throw new Error( | ||
| `You seem to be creating a tensor object. Unfortunately, the '@lenml/tokenizers' library does not support returning any ONNX-related object instances. Please try setting 'return_tensor=false' to avoid this error` | ||
| ); | ||
| if (args[0] instanceof ONNXTensor) { | ||
@@ -55,0 +59,0 @@ // Create shallow copy |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1906909
0.78%21
5%9519
0.87%