SAVRN
Search Contact SAVRN

Open-weight model · Text classification

xlm-roberta-base-language-detection

by Luca Papariello papluca/xlm-roberta-base-language-detection

This model is a fine-tuned version of xlm-roberta-base on the Language Identification dataset. This model is an XLM-RoBERTa transformer model with a classification head on top (i.e. a linear layer on top of the pooled output).

Parameters278M
Context514
Weights3.3 GB
Licensemit
AccessOpen weights
Monthly Downloads579k

Runs On

What it takes to serve xlm-roberta-base-language-detection (278M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.6 GB 0.7 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.3 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

SAVRN's Notes on xlm-roberta-base-language-detection

Sorting inbound text by language before it reaches a larger model is the job this one does, with a 278M-parameter XLM-RoBERTa classifier covering 20 languages. At 16-bit the weights take 0.6 GB and the run needs 0.7 GB; at 8-bit it fits in 0.3 GB. It never gets its own accelerator in our facilities. It rides beside whatever else is on the card, and the cheapest Index host, one MI300X with 192 GB at $1.85 per hour, would give it a fraction of one percent of its memory.

MIT is the license, so a commercial deployment only has to carry the copyright and permission notices. Two checks: the context window is 514 tokens, so long documents get chunked first, and the model is a fine-tune of FacebookAI/xlm-roberta-base on the papluca/language-identification dataset, worth reading if your traffic includes languages outside those 20.

Model Card

By Luca Papariello, published under mit, revision 9865598389ca.

This model is a fine-tuned version of xlm-roberta-base on the Language Identification dataset.

Model description

This model is an XLM-RoBERTa transformer model with a classification head on top (i.e. a linear layer on top of the pooled output). For additional information please refer to the xlm-roberta-base model card or to the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al.

Intended uses & limitations

You can directly use this model as a language detector, i.e. for sequence classification tasks. Currently, it supports the following 20 languages:

arabic (ar), bulgarian (bg), german (de), modern greek (el), english (en), spanish (es), french (fr), hindi (hi), italian (it), japanese (ja), dutch (nl), polish (pl), portuguese (pt), russian (ru), swahili (sw), thai (th), turkish (tr), urdu (ur), vietnamese (vi), and chinese (zh)

Training and evaluation data

Read the full model card (716 words)

Configuration

Architecture
XLMRobertaForSequenceClassification
Context length (tokens)
514
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
250,002
Stored precision
float32
Model type
xlm-roberta

Identity and Version

Repository
papluca/xlm-roberta-base-language-detection
Publisher
Luca Papariello
Task
Text classification
Modality
Text
Library
transformers
Parameters
278M parameters
Languages
ar, bg, de, el, en, es, fr, hi
Revision
9865598389ca9d95637462f743f683b51d75b87b
First published
2022-03-02
Last updated
2023-12-28

Files and Weights

10 files, 3.4 GB in total. The weights are 3 files totalling 3.3 GB in bin, h5, safetensors.

Weights3 files · 3.3 GB
Configuration2 files · 1.7 KB
Tokenizer2 files · 9.1 MB
Documentation1 file · 7.2 KB
Other1 file · 5.1 MB
Repository1 file · 1.2 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights1.1 GB a835d6e8ed50
pytorch_model.binWeights1.1 GB eb6bded160fd
tf_model.h5Weights1.1 GB d6417044a145
config.jsonConfiguration1.4 KB
special_tokens_map.jsonConfiguration239 B
README.mdDocumentation7.2 KB
sentencepiece.bpe.modelOther5.1 MB cfc8146abe2a
.gitattributesRepository1.2 KB
tokenizer.jsonTokenizer9.1 MB
tokenizer_config.jsonTokenizer502 B

License and Download

License
mit
Access
Open weights, no gate
Download size
3.3 GB
Download from Luca Papariello

Released by Luca Papariello through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published3.3 GB
16-bit0.6 GB
8-bit0.3 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Compare xlm-roberta-base-language-detection

Questions About xlm-roberta-base-language-detection

How much GPU memory does xlm-roberta-base-language-detection need?

About 0.7 GB at 16-bit and 0.2 GB at 4-bit: the weights (278M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run xlm-roberta-base-language-detection on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use xlm-roberta-base-language-detection commercially?

Yes. xlm-roberta-base-language-detection is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

What is xlm-roberta-base-language-detection's context length?

514 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Text classification

Bangla-twoclass-Sentiment-Analyzer

Arunava Kar

This model is a fine-tuned version of xlm-roberta-base on the None dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 3e-05 - trainbatchsize: 16 - evalbatchsize: 16 - lrschedulertype: linear - trainingsteps: 1800 - mixedprecisiontraining: Native AMP - Transformers 4.37.2 - Pytorch 2.1.0+cu121 - Datasets 2.17.1 - Tokenizers 0.15.2

Open weights mit 278M parameters 514 tokens transformers

Model · Text classification

snd_sentiment_analysis

Danish Mahdi

This repository contains a fine-tuned XLM-RoBERTa Base model for 3-class sentiment classification in Sindhi. The model predicts one of the following labels: - positive - neutral - negative This model is intended for research, experimentation, and lightweight production prototyping on Sindhi-language sentiment analysis tasks. It may be useful for short-text classification such as reviews, feedback, and social-media snippets. It should not be used as the only basis for high-stakes decisions. Performance can vary by domain, dialect, and writing style, and human review is recommended when errors could affect people or organizations. The saved model artifacts in this repository report the…

Open weights mit 278M parameters 514 tokens transformers

We have updated the new reranker, supporting larger lengths, more languages, and achieving better performance. More details please refer to our Github: FlagEmbedding. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 3/18/2024: Release new rerankers, built upon powerful M3 and LLM (GEMMA and MiniCPM, not so large actually) backbones, supporitng multi-lingual processing and larger inputs, massive improvements of ranking performances on BEIR, C-MTEB/Retrieval, MIRACL, LlamaIndex Evaluation. - 3/18/2024: Release Visualized-BGE, equipping BGE with visual capabilities. Visualized-BGE can be utilized to generate embeddings for hybrid image-text…

Open weights mit 278M parameters 514 tokens sentence-transformers

Model · Text classification

Prompt-Guard-86M

Meta Llama

LLM-powered applications are susceptible to prompt attacks, which are prompts intentionally designed to subvert the developer’s intended behavior of the LLM. Categories of prompt attacks include prompt injection and jailbreaking: - Prompt Injections are inputs that exploit the concatenation of untrusted data from third parties and users into the context window of a model to get a model to execute unintended instructions. - Jailbreaks are malicious instructions designed to override the safety and security features built into a model. Prompt Guard is a classifier model trained on a large corpus of attacks, capable of detecting both explicitly malicious prompts as well as data that contains…

Access requested at publisher llama3.1 279M parameters transformers

Model · Text classification

SciFive-base-Pubmed_PMC

Razent

Paper: SciFive: a text-to-text transformer model for biomedical literature Authors: Long N. Phan, James T. Anibal, Hieu Tran, Shaurya Chanana, Erol Bahadroglu, Alec Peltekian, Grégoire Altan-Bonnet For more details, do check out our Github repo.

Open weights 223M parameters transformers

Model · Text classification

roberta-large-mnli

Facebook AI community

roberta-large-mnli is the RoBERTa large model fine-tuned on the Multi-Genre Natural Language Inference (MNLI) corpus. The model is a pretrained model on English language text using a masked language modeling (MLM) objective. Use the code below to get started with the model. The model can be loaded with the zero-shot-classification pipeline like so: You can then use this pipeline to classify sequences into any of the class names you specify. For example: This fine-tuned model can be used for zero-shot classification tasks, including zero-shot sentence-pair classification (see the GitHub repo for examples) and zero-shot sequence classification. The model should not be used to intentionally…

Open weights mit 356M parameters 514 tokens transformers