Views
No views yet

transformers>=4.51.0
accelerate>=1.6.0
sentencepiece>=0.2.0
flash-attn>=2.7.31import torch
2from transformers import AutoModelForMaskedLM, AutoTokenizer
3
4model_name = "iamtatsuki05/ModernBERT-JP-0.5B-PT-stage2"
5model_kwargs = {
6 "torch_dtype": torch.bfloat16,
7 "attn_implementation": "flash_attention_2",
8 "device_map": "auto",
9}
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11model = AutoModelForCausalLM.from_pretrained(model_name, **model_kwargs)
12
13text = f"ハチワレは{tokenizer.mask_token}のキャラクターです。"
14inputs = tokenizer(text, return_tensors="pt").to(model.device)
15outputs = model(**inputs)
16masked_index = inputs["input_ids"][0].tolist().index(tokenizer.mask_token_id)
17print(tokenizer.decode(outputs.logits[0, masked_index].argmax(axis=-1)))| ID | Architecture | #Param. | #Param. w/o Emb. | JGLUE-Avg | JGLUE-JSTS | JGLUE-JNLI | JGLUE-JCoLA |
|---|---|---|---|---|---|---|---|
| iamtatsuki05/ModernBERT-JP-0.5B-PT-stage2 (this model) | ModernBERT | 679M | 548M | 86.32 | 89.29 | 86.68 | 83.00 |
| iamtatsuki05/Llama-JP-0.5B-PT-stage2 | Llama | 661M | 530M | 81.88 | 82.91 | 78.67 | 84.06 |
1@article{MIREI
2 title={同一条件下における Encoder/Decoder アーキテクチャによる文埋め込みの性能分析},
3 author={岡田 龍樹 and 杉本 徹},
4 journal={言語処理学会第 32 回年次大会 (NLP2026)},
5 year={2026}
6}