antiberta2 / README.md
Xenova's picture
Xenova HF staff
[Automated] Update base model metadata
e0e8b8d verified
metadata
base_model: alchemab/antiberta2
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 JavaScript library from NPM using:

npm i @xenova/transformers

Example: Masked language modelling with Xenova/antiberta2.

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 and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).