If you haven't already, you can install the
Transformers.js
JavaScript library from
NPM
using:
npm i @xenova/transformers
Example:
Information Retrieval w/
Xenova/ms-marco-TinyBERT-L-2-v2
.
import { AutoTokenizer, AutoModelForSequenceClassification } from'@xenova/transformers';
const model = awaitAutoModelForSequenceClassification.from_pretrained('Xenova/ms-marco-TinyBERT-L-2-v2');
const tokenizer = awaitAutoTokenizer.from_pretrained('Xenova/ms-marco-TinyBERT-L-2-v2');
const features = tokenizer(
['How many people live in Berlin?', 'How many people live in Berlin?'],
{
text_pair: [
'Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.',
'New York City is famous for the Metropolitan Museum of Art.',
],
padding: true,
truncation: true,
}
)
const scores = awaitmodel(features)
console.log(scores);
// quantized: [ 7.210887908935547, -11.559350967407227 ]// unquantized: [ 7.235750675201416, -11.562294006347656 ]
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
).
Runs of Xenova ms-marco-TinyBERT-L-2-v2 on huggingface.co
2.7K
Total runs
0
24-hour runs
-85
3-day runs
-46
7-day runs
-1.0K
30-day runs
More Information About ms-marco-TinyBERT-L-2-v2 huggingface.co Model
ms-marco-TinyBERT-L-2-v2 huggingface.co
ms-marco-TinyBERT-L-2-v2 huggingface.co is an AI model on huggingface.co that provides ms-marco-TinyBERT-L-2-v2's model effect (), which can be used instantly with this Xenova ms-marco-TinyBERT-L-2-v2 model. huggingface.co supports a free trial of the ms-marco-TinyBERT-L-2-v2 model, and also provides paid use of the ms-marco-TinyBERT-L-2-v2. Support call ms-marco-TinyBERT-L-2-v2 model through api, including Node.js, Python, http.
ms-marco-TinyBERT-L-2-v2 huggingface.co is an online trial and call api platform, which integrates ms-marco-TinyBERT-L-2-v2's modeling effects, including api services, and provides a free online trial of ms-marco-TinyBERT-L-2-v2, you can try ms-marco-TinyBERT-L-2-v2 online for free by clicking the link below.
Xenova ms-marco-TinyBERT-L-2-v2 online free url in huggingface.co:
ms-marco-TinyBERT-L-2-v2 is an open source model from GitHub that offers a free installation service, and any user can find ms-marco-TinyBERT-L-2-v2 on GitHub to install. At the same time, huggingface.co provides the effect of ms-marco-TinyBERT-L-2-v2 install, users can directly use ms-marco-TinyBERT-L-2-v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ms-marco-TinyBERT-L-2-v2 install url in huggingface.co: