File size: 1,418 Bytes
059ad3e e0e8b8d 059ad3e f315648 059ad3e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
---
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](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`). |