Audio logits (talker head) can contain NaN from FP16 overflow when
vision features are present. Guard with nan_to_num before softmax
and multinomial, matching existing text path protection.
Revert camera prompt changes; add NaN guard and CUDA sync; add engineering challenges doc
- prepare_turn: restored original '请描述这张图片' prompt + image tokens after text
- build_ids: removed system prompt and image_context parameter
- model.py stream_generate: added nan_to_num guard on logits/probs
- omni_o_call.py: added torch.cuda.synchronize() after ASR before generation
- docs/interview/challenges.md: new document covering real engineering challenges
- docs/interview/index.md: added link to challenges.md
Cast logits to float32 before softmax/sampling to prevent fp16 overflow
- Text logits: .clone().float() / temperature
- Audio logits: .clone().float() / 0.2
fp16 overflow in attention or lm_head can produce inf logits, making
softmax output NaN and crashing multinomial with CUDA device-side assert.
Fix from_pretrained: use SenseVoice/Siglip encoder wrappers instead of raw models
VAM.__init__ wraps encoders in SenseVoiceAudioEncoder / SiglipVisionEncoder
(expected by encode_audio_inputs / get_image_embeddings), but from_pretrained
override used load_sensevoice/load_vision which returned raw encoder modules.
Convert omni-o.pth to HF format + add from_pretrained support
- scripts/convert_omni_o_to_hf.py: convert .pth -> config.json + model.safetensors
- src/models/vam/model.py: from_pretrained override loads encoders after meta init
- src/models/vam/model.py: __init__ skips encoder loading on meta device
- scripts/omni_o_call.py: auto-detect HF dir and load via VAM.from_pretrained
- auto_map in config.json points to modeling_omni_o.py for trust_remote_code
Add omni_o_call.py: real-time voice call server for omni-o checkpoint
- New script scripts/omni_o_call.py: Flask WebSocket server for real-time
voice conversation with VAD-based interrupt/barge-in detection
- Fix SileroVAD: use silero-vad v6.2.1 OnnxWrapper (handles context
and state correctly)
- Fix RealtimeSession: reduce VAD threshold 0.8→0.5 (Silero default),
reduce window size 1024→512 (required by silero-vad v6)
- Fix omni_web_demo.py: update VAD path to checkpoint/vad/
Fix generate() to return last text tokens instead of (None, audio_frame) tuple
When stream=False, generate() now finds the last yield with non-None
text tokens instead of returning tokens[-1] which is (None, audio_frame)
after text generation finishes.
Root cause: funasr.AutoModel (loaded by SenseVoice encoder) and pyarrow
have a C library initialization conflict causing iter_batches to hang.
Fix:
- lazy-import pyarrow in VAMDataset/VLMDataset.__init__ (after model loads)
- remove unused pyarrow imports from dataset/common.py
- replace librosa.resample with torchaudio.resample (avoids numba+numpy 2.5
incompatibility)
- reduce iter_batches batch_size from 65536 to 4096 (lower memory)
Config updates:
- point Stage 2 (audio_proj) to omni-v Stage 1 checkpoint
- add explicit device: cuda to omni-v config
- Rename vlm.yaml→vlm_pretrain.yaml, vlm_moe.yaml→vlm_pretrain_moe.yaml
- Add vlm_sft.yaml and vlm_sft_moe.yaml for VLM SFT training
- Add --weight_path, --model_dir, --vision_dir, --tokenizer_dir to VLM trainer
- Update init_vlm_model to support weight_path and model_dir for decoupled loading
- Update VLM pretrain default data_path to dataset/vlm/
- Sync all doc references to new config filenames
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
refactor: reorganize dataset into lm/vlm/vam subdirectories
Move all .jsonl data files to dataset/lm/ and update configs, trainers,
and docs to reflect the new paths.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
docs: update README and docs for model_type rename, RoPE guard fix, config paths
The transformer block is a generic primitive reused by lm/vlm/vam
backbones, so rename MiniMindBlock -> Block in core/block.py and update
all references (core/__init__, models/__init__, models/lm/model.py,
models/vam/model.py, lora comment).
Co-Authored-By: opencode <noreply@opencode.ai>
Move LoRA into models/lm to match modality-scoped layout
Relocate models/lora.py to models/lm/lora.py (LoRA targets MiniMind's
q/k/v/o and gate/up/down Linear layers, so it belongs with the LM
backbone; it also applies to the shared LLM layers of VLM/Omni but
deliberately skips vision/audio projectors and the speech talker head).
Updated direct imports in trainers/lora.py and examples; models/__init__
re-exports the symbols. Added a scope note to the module. README updated.
Co-Authored-By: opencode <noreply@opencode.ai>
Move MiniMindModel backbone into models/lm, keep core pure-components only
Relocate the MiniMindModel Transformer backbone from core/model.py into
models/lm/model.py (alongside MiniMindForCausalLM), so core/ now holds
only reusable primitive components (norm/rope/attention/mlp/block).
Update core/__init__ and models/__init__ export paths accordingly;
models/__init__ re-exports MiniMindModel from omni.models.lm.model.
README updated.
Co-Authored-By: opencode <noreply@opencode.ai>
Restructure models into lm/vlm/vam sub-packages by modality
Split the flat model modules into three modality-scoped sub-packages,
each with a config.py (configuration) and model.py (modeling code):
- models/lm/ : pure text -> MiniMindConfig + MiniMindForCausalLM
- models/vlm/ : text + vision -> VLMConfig + MiniMindVLM
- models/vam/ : text + audio -> OmniConfig + MiniMindOmni (+ TalkerModule)
models/__init__.py re-exports all symbols so existing
`from omni.models import ...` references keep working. Updated
trainers/examples/utils that imported the old flat submodule paths.
README reflects the new layout.
Co-Authored-By: opencode <noreply@opencode.ai>
Fuse minimind/minimind-v/minimind-o into omni with layered architecture