跳到正文
DEV Community· gulnur·· 5 天前AI 評分40

Transformers.js:在瀏覽器直接執行 AI 模型

Transformers.js: Running AI Models Directly in the Browser

AI 導讀

Hugging Face 開發的開源 JavaScript 函式庫 Transformers.js,讓預訓練機器學習模型可直接在瀏覽器及 Node.js、Deno、Bun 等 JavaScript 執行環境中運作。

正文

Cover image for Transformers.js: Running AI Models Directly in the Browser

gulnur

Transformers.js is an open-source JavaScript library developed by Hugging Face that allows you to run pretrained machine learning models directly in web browsers and JavaScript runtimes such as Node.js, Deno, and Bun.

It supports a variety of tasks, including text classification, sentiment analysis, image classification, audio processing, and feature extraction. It also allows developers to use many pretrained models from the Hugging Face Hub without having to build an inference backend from scratch.

One of the most interesting features of Transformers.js is that models can run locally in the browser, depending on the model and available hardware. This can reduce reliance on external inference APIs and allow certain inputs to be processed on the user's device.

Image Credit: Wordline

來源:DEV Community · dev.to