cohere2¶
Model type |
|
Class |
|
Task |
|
Source |
|
Description¶
Cohere and Cohere2 causal language model.
Differences from CausalLMModel:
Uses
LayerNorm(not RMSNorm) for all normalizations.Parallel pre-norm decoder: a single
input_layernormis shared by both the attention and MLP branches; their outputs are summed together before the residual addition.logit_scale: the final logits are multiplied by a scalar from the HuggingFace config (default 0.0625 = 1/16).
Replicates HuggingFace’s CohereForCausalLM and Cohere2ForCausalLM.
Usage¶
mobius build --model <MODEL_ID> output_dir/
from mobius import build
model = build("<MODEL_ID>")