@cyberlangke/tokkit-microsoft 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COPYRIGHT +15 -0
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/generated/phi_1.cjs +25 -0
- package/dist/generated/phi_1.js +5 -0
- package/dist/generated/phi_3_5.cjs +25 -0
- package/dist/generated/phi_3_5.js +5 -0
- package/dist/generated/phi_3_medium.cjs +25 -0
- package/dist/generated/phi_3_medium.js +5 -0
- package/dist/generated/phi_3_mini.cjs +25 -0
- package/dist/generated/phi_3_mini.js +5 -0
- package/dist/generated/phi_4.cjs +25 -0
- package/dist/generated/phi_4.js +5 -0
- package/dist/generated/phi_4_mini.cjs +25 -0
- package/dist/generated/phi_4_mini.js +5 -0
- package/dist/generated/phi_4_mini_flash.cjs +25 -0
- package/dist/generated/phi_4_mini_flash.js +5 -0
- package/dist/generated/phi_4_mini_reasoning.cjs +25 -0
- package/dist/generated/phi_4_mini_reasoning.js +5 -0
- package/dist/generated/phi_4_reasoning.cjs +25 -0
- package/dist/generated/phi_4_reasoning.js +5 -0
- package/dist/generated/phi_moe.cjs +25 -0
- package/dist/generated/phi_moe.js +5 -0
- package/dist/index.cjs +111 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +85 -0
- package/package.json +40 -0
package/COPYRIGHT
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Copyright (c) 2026 cyberlangke
|
|
2
|
+
|
|
3
|
+
This package bundles tokenizer assets derived from official Hugging Face repositories under the microsoft organization:
|
|
4
|
+
- microsoft/phi-1 tokenizer.json
|
|
5
|
+
- microsoft/Phi-3-mini-4k-instruct tokenizer.json
|
|
6
|
+
- microsoft/Phi-3-medium-4k-instruct tokenizer.json
|
|
7
|
+
- microsoft/Phi-3.5-mini-instruct tokenizer.json
|
|
8
|
+
- microsoft/Phi-mini-MoE-instruct tokenizer.json
|
|
9
|
+
- microsoft/phi-4 tokenizer.json
|
|
10
|
+
- microsoft/Phi-4-mini-instruct tokenizer.json
|
|
11
|
+
- microsoft/Phi-4-mini-reasoning tokenizer.json
|
|
12
|
+
- microsoft/Phi-4-mini-flash-reasoning tokenizer.json
|
|
13
|
+
- microsoft/Phi-4-reasoning tokenizer.json
|
|
14
|
+
|
|
15
|
+
See LICENSE for the full license text that applies to this package and its bundled assets.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cyberlangke
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @cyberlangke/tokkit-microsoft
|
|
2
|
+
|
|
3
|
+
Microsoft 官方 tokenizer 的 tokkit 子包,当前包含 Phi 主线内置 family。
|
|
4
|
+
|
|
5
|
+
## 支持的模型
|
|
6
|
+
|
|
7
|
+
- [`microsoft/Phi-4-mini-instruct`](https://huggingface.co/microsoft/Phi-4-mini-instruct)
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @cyberlangke/tokkit-microsoft
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { getTokenizer } from "@cyberlangke/tokkit-microsoft"
|
|
17
|
+
|
|
18
|
+
const tokenizer = await getTokenizer("phi-4-mini")
|
|
19
|
+
|
|
20
|
+
console.log(tokenizer.vocabSize)
|
|
21
|
+
```
|