--- library_name: transformers.js --- https://huggingface.co/alchemab/antiberta2 with ONNX weights to be compatible with Transformers.js. ## Usage (Transformers.js) If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@xenova/transformers) using: ```bash npm i @xenova/transformers ``` **Example:** Masked language modelling with `Xenova/antiberta2`. ```js import { pipeline } from '@xenova/transformers'; // Create a masked language modelling pipeline const pipe = await pipeline('fill-mask', 'Xenova/antiberta2'); const output = await pipe('Ḣ Q V Q ... C A [MASK] D ... T V S S'); console.log(output); // [ // { // score: 0.48774364590644836, // token: 19, // token_str: 'R', // sequence: 'Ḣ Q V Q C A R D T V S S' // }, // { // score: 0.2768442928791046, // token: 18, // token_str: 'Q', // sequence: 'Ḣ Q V Q C A Q D T V S S' // }, // ... // ] ``` --- Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).