transformerjs-breadboard-kit

A lot of the tools that I build that interact with LLMs are built with Breadboard. I needed to be able to run a number of tasks on the device that I have the board without using an LLM in the cloud. TransformerJS is a great API for JS developers to work with a number of different models that are hosted on HuggingFace. To get this working with breadboard I needed to create a Kit.


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan

A lot of the tools that I build that interact with LLMs are built with Breadboard. I needed to be able to run a number of tasks on the device that I have the board without using an LLM in the cloud. TransformerJS is a great API for JS developers to work with a number of different models that are hosted on HuggingFace. To get this working with breadboard I needed to create a Kit.... so here we are.

You can find the code here and if you are using breadboard you can install it as npm i @paulkinlan/transformerjs-breadboard-kit

To create an Breadboard agent you can do it as follows:

import { board } from "@google-labs/breadboard";
import { sentiment } from "@paulkinlan/transformerjs-breadboard-kit"

export default await board(({ text, model }) => {
    text.isString();
    model.isString();

    const summarynode = transformersjs.summarize({
      $id: "summary",
      input: text,
      model,
    });

    return summarynode.to(base.output());
  }).serialize({
  title: "Summary board",
  description: "Runs the summarization analysis with transformer JS",
  version: "0.0.2",
});


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan


Print Share Comment Cite Upload Translate Updates
APA

Paul Kinlan | Sciencx (2024-02-23T07:45:00+00:00) transformerjs-breadboard-kit. Retrieved from https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/

MLA
" » transformerjs-breadboard-kit." Paul Kinlan | Sciencx - Friday February 23, 2024, https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/
HARVARD
Paul Kinlan | Sciencx Friday February 23, 2024 » transformerjs-breadboard-kit., viewed ,<https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/>
VANCOUVER
Paul Kinlan | Sciencx - » transformerjs-breadboard-kit. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/
CHICAGO
" » transformerjs-breadboard-kit." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/
IEEE
" » transformerjs-breadboard-kit." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/. [Accessed: ]
rf:citation
» transformerjs-breadboard-kit | Paul Kinlan | Sciencx | https://www.scien.cx/2024/02/23/transformerjs-breadboard-kit/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.