semji/gpt-3-tokenizer-php
最新稳定版本:v2.0.0
Composer 安装命令:
composer require semji/gpt-3-tokenizer-php
包简介
PHP Text Tokenizer for GPT models
README 文档
README
PHP Text Tokenizer for GPT models
About
A PHP toolkit to tokenize text like GPT family of models process it.
Forked from https://github.com/CodeRevolutionPlugins/GPT-3-Encoder-PHP to fit our usage, fix bugs and add unit testing.
Usage
The mbstring PHP extension is needed for this tool to work correctly (in case non-ASCII characters are present in the tokenized text): details here on how to install mbstring PHP 8.1 is needed too;
use Semji\GPT3Tokenizer\Encoder; $prompt = "Many words map"; $encoder = new Encoder(); $encoder->encode($prompt);
统计信息
- 总下载量: 125.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04