Transformers.js 文档

安装

您正在查看的是需要从源码安装。如果您想使用常规的 npm install,请查看最新的稳定版本(v3.0.0)。
Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

安装

要通过 NPM 安装,请运行

npm i @huggingface/transformers

或者,您可以在原生 JS 中使用它,无需任何打包工具,通过使用 CDN 或静态托管。例如,使用 ES 模块,您可以通过以下方式导入库

<script type="module">
    import { pipeline } from 'https://cdn.jsdelivr.net.cn/npm/@huggingface/transformers@3.7.1';
</script>
< > 在 GitHub 上更新