- Added SCENE_LOCK to prevent multiple concurrent scene refreshes
- _refresh_scene uses MODEL_LOCK.acquire(blocking=False) — skips if model busy
- Only refreshes every SCENE_REFRESH_INTERVAL (3s) to throttle camera frames
- Conversation (run_generate) always has priority over scene refresh
Camera: inject scene text instead of raw img_tokens to avoid description mode
Approach A: when camera frame arrives, background thread generates a
one-sentence scene summary using the model itself (img_tokens once,
for summarization). Cached scene_text is then injected as pure text
context: '[摄像头场景: ...]', without pixel_values or image_pad tokens.
This avoids triggering the model's trained bias (img_tokens → describe)
while still providing visual context. If scene isn't ready yet, falls
back to original img_tokens behavior.
- _generate_scene(): model self-summarizes image in one sentence
- _refresh_scene(): async thread, updates state cache
- prepare_turn: accepts scene_text param, uses text context when available
- set_ctx: triggers scene refresh on new camera frame
Remove '请描述这张图片' from camera prompt; img_tokens before user text
- 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
- Image tokens now placed BEFORE user text so model 'sees' image first
- System prompt added when camera active: 'Use visual context naturally,
do not describe unless asked'
- Helps model distinguish live camera feed from an image description task
Model emits visual descriptions from image tokens alone without an explicit
instruction; removing it gives model freedom to handle images in any context.
Fix camera: don't force 'describe this image' when user has text input
prepare_turn now only prepends '请描述这张图片' when there's no user text.
With user input (ASR/typed), image tokens are appended as visual context
without overriding the user's conversation intent.
Move audio/vision encoder .to(device) after model init for both HF and .pth paths
- --load_from defaults to checkpoint/omni-o-hf (HF format)
- Auto-detect HF vs .pth and load correctly
- model_name inferred from directory name when weight is empty
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
Replace web_demo.html with omni_o_web.html: self-contained frontend for omni-o call
New frontend features:
- Chat mode (SSE /chat): text messages with audio playback
- Call mode (WebSocket /ws/realtime): real-time voice with VAD orb,
animated audio visualizer, interruption feedback
- Camera integration: periodic snapshots as visual context
- Voice cloning: record via browser MediaRecorder, clone via
/clone_voice and /delete_voice endpoints
- History preserved between turns
- Background RealtimeRecorder thread captures mic continuously + VAD
- During generation, each step checks recorder.interrupt flag
- During audio playback, poll sd.get_stream().active with interrupt check
- Interrupt: stop generation immediately + stop playback via sd.stop()
- Completed audio delivered to main thread via queue.Queue
Command-line voice conversation using mic + Silero VAD + SenseVoice ASR
+ omni-o model + Mimi audio decoding. Supports auto VAD mode (silence
detection) and manual push-to-talk mode (--wait_key 1).
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/