Downloads · 30 days
15
18% of all-time downloads
zeromodels/deberta_v3_small
deberta_v3_small is a fill-mask model from zeromodels. Use it when you need the model to fill a missing word. It is set up for zeromodels. The card lists the license as mit.
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/deberta/) [](https://huggingface.co/collections/zeromodels/deberta-v1-v2-v3-6a8eae49464403784b9d6cd0)
Downloads · 30 days
15
18% of all-time downloads
All-time downloads
82
Public
Repo size
565 MB
Likes
0
Public
Click a slice to open those files.
.h5565 MB · 99%
From the Hugging Face model README
Papers: DeBERTa: Decoding-enhanced BERT with Disentangled Attention (arXiv:2006.03654) · DeBERTaV3 (arXiv:2111.09543) · HF Papers
DeBERTa is Microsoft's disentangled-attention text encoder (content + relative position). v1 uses byte-level BPE; v2/v3 use SentencePiece. v3 adds ELECTRA-style pretraining with gradient-disentangled embedding sharing. Import from deberta / deberta_v2 / deberta_v3 to match the generation.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of microsoft/deberta-v3-small for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a fill-mask / encoder checkpoint (DebertaV3MaskedLM, v3 small). Task heads (sequence/token classify, QA, …) load via hf: fine-tunes.
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.deberta_v3 import (
DebertaV3MaskedLM,
DebertaV3Tokenizer,
)
mlm = DebertaV3MaskedLM.from_weights("zeromodels/deberta_v3_small")
tokenizer = DebertaV3Tokenizer.from_weights("zeromodels/deberta_v3_small")
inputs = tokenizer("The capital of France is [MASK].")
logits = mlm(inputs) # (1, L, vocab_size)
mask = int((inputs["input_ids"][0] == tokenizer.mask_token_id).argmax())
print(tokenizer.decode([int(logits[0, mask].argmax())]))
Load any DeBERTa variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub | Generation |
|---|---|---|
deberta_base | zeromodels/deberta_base | v1 |
deberta_large | zeromodels/deberta_large | v1 |
deberta_v2_xlarge | zeromodels/deberta_v2_xlarge | v2 |
deberta_v2_xxlarge | zeromodels/deberta_v2_xxlarge | v2 |
deberta_v3_xsmall | zeromodels/deberta_v3_xsmall | v3 |
deberta_v3_small | zeromodels/deberta_v3_small | v3 |
deberta_v3_base | zeromodels/deberta_v3_base | v3 |
deberta_v3_large | zeromodels/deberta_v3_large | v3 |
Load any of these from this repo with from_weights("zeromodels/deberta_v3_small") (or on the fly via the hf: prefix). The pretrained backbone is shared; task heads not stored in this checkpoint start randomly initialized, ready for fine-tuning (or load a hf: fine-tune).
| Class | Task |
|---|---|
DebertaV3Model | Encoder backbone |
DebertaV3MaskedLM | Masked language modeling (fill-mask) |
DebertaV3SequenceClassify | Sequence classification |
DebertaV3TokenClassify | Token classification (NER / POS) |
DebertaV3QnA | Extractive question answering |
DebertaV3MultipleChoice | Multiple choice |
from zeromodels.models.deberta_v3 import DebertaV3SequenceClassify
model = DebertaV3SequenceClassify.from_weights("zeromodels/deberta_v3_small")
KERAS_BACKEND before importing Keras / zeromodels.Tokenizer.from_weights(...) so vocab and mask token match.hf: prefix, e.g. DebertaV3MaskedLM.from_weights("hf:microsoft/deberta-v3-small").A huge thank you to the Microsoft DeBERTa authors for creating and releasing these models.
License: MIT.