RoFormer (Chinese base)

https://arxiv.org/abs/2104.09864

Lucid port of transformers/junnyu/roformer_chinese_base, converted to Lucid-native safetensors.

Available weights

Tag Params GFLOPs Size Source
CLUECORPUSSMALL (default) 123.6M — 473.23 MB transformers

Usage

import lucid
import lucid.models as models
from lucid.models.weights import RoformerWeights

# default tag
model = models.roformer(pretrained=True)

# explicit tag (enum or string)
model = models.roformer(weights=RoformerWeights.CLUECORPUSSMALL)
model = models.roformer(pretrained="CLUECORPUSSMALL")

# feed token ids (tokenize with the matching lucid.utils.tokenizer)
input_ids = lucid.tensor([[101, 7592, 2088, 102]], dtype=lucid.int64)
out = model(input_ids)
hidden = out.last_hidden_state  # (B, T, hidden_size)

Conversion

Converted from transformers/junnyu/roformer_chinese_base via python -m tools.convert_weights roformer --tag CLUECORPUSSMALL. Key mapping + numerical parity verified against the source.

License

apache-2.0 — inherited from the original weights.

Citation

Su et al., "RoFormer: Enhanced Transformer with Rotary Position Embedding", 2021.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for lucid-dl/roformer-chinese-base