kwja-mlx
This repository contains MLX-converted weights for upstream KWJA checkpoints.
Source
The files here are converted from the official KWJA checkpoint releases under kwja==2.5.1 / model version v2.4.
The original checkpoint files are downloaded from:
https://lotus.kuee.kyoto-u.ac.jp/kwja/v2.4/
Converted modules are provided for three model sizes:
tinybaselarge
Each size includes three modules:
charseq2seqword
Upstream module mapping
| Size | Module | Upstream checkpoint | Base encoder / model |
|---|---|---|---|
tiny |
char |
char_deberta-v2-tiny-wwm.ckpt |
ku-nlp/deberta-v2-tiny-japanese-char-wwm |
tiny |
seq2seq |
seq2seq_t5-small.ckpt |
retrieva-jp/t5-small-short |
tiny |
word |
word_deberta-v2-tiny.ckpt |
ku-nlp/deberta-v2-tiny-japanese |
base |
char |
char_deberta-v2-base-wwm.ckpt |
ku-nlp/deberta-v2-base-japanese-char-wwm |
base |
seq2seq |
seq2seq_t5-base.ckpt |
retrieva-jp/t5-base-long |
base |
word |
word_deberta-v2-base.ckpt |
ku-nlp/deberta-v2-base-japanese |
large |
char |
char_deberta-v2-large-wwm.ckpt |
ku-nlp/deberta-v2-large-japanese-char-wwm |
large |
seq2seq |
seq2seq_t5-large.ckpt |
retrieva-jp/t5-large-long |
large |
word |
word_deberta-v2-large.ckpt |
ku-nlp/deberta-v2-large-japanese |
Conversion method
The conversion is a format conversion from PyTorch Lightning checkpoints to MLX runtime bundles.
High-level steps:
- Load the original
.ckptfile on CPU. - Read model metadata from the checkpoint
hyper_parameters. - Extract the relevant module weights from the checkpoint
state_dict. - Remap or sanitize tensor names where needed so they match the MLX module layout.
- Save weights as
.mlx.safetensors. - Save loader metadata as a sidecar
.mlx.jsonfile.
Module-specific notes:
char: exports the DeBERTa encoder and tagging heads; the convolution weight is transposed to match the MLX layout.seq2seq: exports the encoder-decoder weights after stripping theencoder_decoder.prefix and sanitizing them for the MLX T5 implementation.word: exports the DeBERTa encoder, prediction heads, and CRF transition parameters used at inference time.
The conversion command used in the companion tooling is:
python -m hira kwja-export-mlx --model-size base --module all
The same conversion flow is used for tiny and large.
File layout
Each converted module is stored as a pair of files:
<size>/<module>.mlx.safetensors: MLX weights<size>/<module>.mlx.json: metadata needed to reconstruct the tokenizer/config/runtime bundle
Examples:
base/char_deberta-v2-base-wwm.mlx.safetensorsbase/char_deberta-v2-base-wwm.mlx.jsonbase/seq2seq_t5-base.mlx.safetensorsbase/seq2seq_t5-base.mlx.jsonbase/word_deberta-v2-base.mlx.safetensorsbase/word_deberta-v2-base.mlx.json
Scope
This repository is intended to host converted MLX artifacts. It does not add new training, fine-tuning, or evaluation results beyond the upstream KWJA checkpoints.
Quantized