Fill-Mask
Transformers
Safetensors
Chinese
Japanese
English
modernbert
masked-language-modeling
feature-extraction
multilingual
text-to-speech
Instructions to use KdaiP/ModernBERT-CJE-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KdaiP/ModernBERT-CJE-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="KdaiP/ModernBERT-CJE-large")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("KdaiP/ModernBERT-CJE-large") model = AutoModelForMaskedLM.from_pretrained("KdaiP/ModernBERT-CJE-large", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ModernBERT-CJE-large
ModernBERT-CJE-large is a text encoder for Chinese, Japanese, and English, pretrained from scratch using the ModernBERT architecture. It provides contextual token representations for downstream NLP tasks, text-to-speech (TTS) systems, and other applications that use text features.
This repository contains the large checkpoint, including its masked language modeling head and tokenizer. A distilled ModernBERT-CJE-tiny variant is also available.
Source code, pretraining, distillation, evaluation details, and more examples: KdaiP/ModernBERT-CJE on GitHub.
Quick start
import torch
from transformers import AutoModel, AutoTokenizer
model_id = "KdaiP/ModernBERT-CJE-large"
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModel.from_pretrained(model_id).to(device).eval()
texts = [
"δ½ ε₯½οΌδΈηοΌ",
"γγγ«γ‘γ―γδΈηοΌ",
"Hello, world!",
]
inputs = tokenizer(
texts,
padding=True,
truncation=True,
max_length=4096,
return_tensors="pt",
).to(device)
with torch.inference_mode():
outputs = model(**inputs, return_dict=True)
features = outputs.last_hidden_state
print(features.shape) # [batch_size, padded_sequence_length, 1024]
License
This model is released under the MIT License.
- Downloads last month
- 32