mstar.model.omnivoice.config#

Configuration for OmniVoice (k2-fsa/OmniVoice).

OmniVoice is a masked-diffusion TTS model, not an autoregressive one. A Qwen3-0.6B body runs bidirectionally over a fixed-length canvas laid out as

[ style tokens | text tokens | (ref audio tokens) | target MASK tokens ]

where every position carries num_audio_codebook rows. Text positions repeat the same token id across all rows; audio positions hold one codebook entry per row. Generation unmasks the target region over num_step iterations and the Higgs-Audio-v2 codec turns the finished token canvas into a waveform.

The architecture values are facts of the checkpoint’s config.json, hardcoded so constructing the model never touches the network. OmniVoiceModel._refresh_checkpoint_defaults re-reads the ones that would silently break parity if the checkpoint drifted.

Classes

OmniVoiceBackboneConfig([hidden_size, ...])

The Qwen3 body, read bidirectionally.

OmniVoiceConfig([backbone, generation, ...])

OmniVoice model configuration.

OmniVoiceGenerationDefaults([num_step, ...])

Per-request decoding knobs and their defaults.

class mstar.model.omnivoice.config.OmniVoiceBackboneConfig(hidden_size=1024, num_hidden_layers=28, num_attention_heads=16, num_key_value_heads=8, head_dim=128, intermediate_size=3072, vocab_size=151676, rms_norm_eps=1e-06, rope_theta=1000000.0, max_position_embeddings=40960, tie_word_embeddings=True)[source]#

Bases: object

The Qwen3 body, read bidirectionally.

Identical in shape to Qwen3ForCausalLM at 0.6B, with two differences that matter at serving time: attention is non-causal (every position sees the whole document, prefix included), and there is no KV cache — the target region changes every diffusion step, and because the prefix attends into that region its hidden states change too, so nothing is reusable across steps. use_cache in the checkpoint config is vestigial.

Parameters:
  • hidden_size (int)

  • num_hidden_layers (int)

  • num_attention_heads (int)

  • num_key_value_heads (int)

  • head_dim (int)

  • intermediate_size (int)

  • vocab_size (int)

  • rms_norm_eps (float)

  • rope_theta (float)

  • max_position_embeddings (int)

  • tie_word_embeddings (bool)

head_dim: int = 128#
hidden_size: int = 1024#
intermediate_size: int = 3072#
max_position_embeddings: int = 40960#
num_attention_heads: int = 16#
num_hidden_layers: int = 28#
num_key_value_heads: int = 8#
rms_norm_eps: float = 1e-06#
rope_theta: float = 1000000.0#
tie_word_embeddings: bool = True#
vocab_size: int = 151676#
class mstar.model.omnivoice.config.OmniVoiceConfig(backbone=<factory>, generation=<factory>, num_audio_codebook=8, audio_vocab_size=1025, audio_mask_id=1024, sample_rate=24000, frame_rate=25.0, max_target_seconds=30.0, max_batch_size=16, max_packed_tokens=24576, load_dtype='float16', checkpoint_dtype=None)[source]#

Bases: object

OmniVoice model configuration.

Parameters:
property audio_embedding_rows: int#

Rows in audio_embeddings — one codebook’s vocab per row block.

audio_mask_id: int = 1024#
audio_vocab_size: int = 1025#
backbone: OmniVoiceBackboneConfig#
checkpoint_dtype: str | None = None#
frame_rate: float = 25.0#
generation: OmniVoiceGenerationDefaults#
load_dtype: str = 'float16'#
max_batch_size: int = 16#
max_packed_tokens: int = 24576#
max_target_seconds: float = 30.0#
num_audio_codebook: int = 8#
sample_rate: int = 24000#
seconds_for_target_tokens(tokens)[source]#
Parameters:

tokens (int)

Return type:

float

target_tokens_for_seconds(seconds)[source]#
Parameters:

seconds (float)

Return type:

int

class mstar.model.omnivoice.config.OmniVoiceGenerationDefaults(num_step=32, guidance_scale=2.0, t_shift=0.1, layer_penalty_factor=5.0, position_temperature=5.0, class_temperature=0.0, denoise=True, max_num_step=64)[source]#

Bases: object

Per-request decoding knobs and their defaults.

Every one of these is per-request: they ride step_metadata and are resolved once in OmniVoiceModel.get_initial_forward_pass_args. This is the reason to serve OmniVoice on a graph runtime at all — a fixed-pipeline port has to pick one value for the whole server.

Parameters:
class_temperature: float = 0.0#
denoise: bool = True#
guidance_scale: float = 2.0#
layer_penalty_factor: float = 5.0#
max_num_step: int = 64#
num_step: int = 32#
position_temperature: float = 5.0#
t_shift: float = 0.1#