CCCCyx commited on
Commit
686e285
·
verified ·
1 Parent(s): f55d7c8

Update README

Browse files
Files changed (1) hide show
  1. README.md +29 -18
README.md CHANGED
@@ -4,7 +4,7 @@ language:
4
  - en
5
  library_name: transformers
6
  pipeline_tag: video-text-to-text
7
- base_model: OpenMOSS-Team/MOSS-VL-Base-0708
8
  tags:
9
  - moss_vl
10
  - feature-extraction
@@ -24,15 +24,15 @@ tags:
24
  <img src="assets/logo.png" width="300" alt="MOSS-VL"/>
25
  </p>
26
 
27
- # MOSS-VL-Realtime-0708
28
 
29
  ## Introduction
30
 
31
- MOSS-VL-Realtime-0708 is the realtime streaming checkpoint of the MOSS-VL 0708 release, part of the OpenMOSS ecosystem for open visual understanding.
32
 
33
- Unlike offline video-language models that first read a complete video and then answer, MOSS-VL-Realtime-0708 is designed for continuous video streams. It can perceive incoming frames and generate text in parallel, support multi-turn realtime interaction, answer questions at arbitrary moments in the stream, and decide whether to speak or keep observing when the visual evidence is not yet sufficient.
34
 
35
- The 0708 release keeps the MOSS-VL cross-attention design and a 256K text context window while adding realtime streaming data and an inference interface for timestamped frame-by-frame input.
36
 
37
  ## Highlights
38
 
@@ -40,11 +40,11 @@ The 0708 release keeps the MOSS-VL cross-attention design and a 256K text contex
40
  - Proactive silence: the model can emit `<|silence|>` and continue observing when no important visual event has happened or the context is insufficient.
41
  - Dynamic correction: as new frames arrive, the model can update or correct earlier responses instead of being locked to an initial interpretation.
42
  - Native timestamped frames: each streamed frame is associated with an absolute timestamp, helping the model reason about event order, duration, pacing, and fine-grained temporal localization.
43
- - Open MOSS-VL family: released together with MOSS-VL-Instruct-0708 and MOSS-VL-Base-0708 for offline use, continued pretraining, fine-tuning, and applied research.
44
 
45
  ## Realtime Interaction
46
 
47
- MOSS-VL-Realtime-0708 exposes a model-owned streaming loop through `create_realtime_session(...)`, `online_generate(...)`, and `real_time_generate(...)`.
48
 
49
  The recommended deployment API is `create_realtime_session(...)`. A service or application owns the video capture pipeline, converts camera, screen, or video-file input into PIL-compatible frames, and pushes each frame with a non-decreasing timestamp:
50
 
@@ -53,11 +53,13 @@ The recommended deployment API is `create_realtime_session(...)`. A service or a
53
  - `session.push_prompt_frame(prompt, image, timestamp=...)` aligns a prompt with a specific frame.
54
  - `session.poll_output(...)` or `session.stream_outputs(...)` returns incremental text chunks.
55
 
 
 
56
  For backend systems that already use queues, `online_generate(...)` accepts dictionaries containing frames, prompts, events, reset controls, and stop controls.
57
 
58
  ## Model Architecture
59
 
60
- MOSS-VL-Realtime-0708 adopts a cross-attention-based vision-language architecture that decouples visual encoding from language reasoning. This design is important for realtime usage because incoming visual content can be integrated into the running generation context without forcing the model into a strictly offline "load all frames, then answer" workflow.
61
 
62
  <p align="center">
63
  <img src="assets/architecture.png" alt="MOSS-VL Architecture" width="100%"/>
@@ -87,13 +89,13 @@ MOSS-VL uses Cross-attention Rotary Position Embedding (XRoPE), which maps text
87
 
88
  ## Model Performance
89
 
90
- MOSS-VL-Realtime-0708 is designed for streaming video understanding benchmarks where questions can arrive before a full video has been observed and correct answers may change as the scene evolves. It targets realtime interaction quality, proactive silence, and dynamic response updates in addition to standard video understanding accuracy.
91
 
92
  <p align="center">
93
  <img src="assets/benchmark-streaming.png" alt="MOSS-VL Streaming Benchmark" width="100%"/>
94
  </p>
95
 
96
- Detailed benchmark tables and comparisons for the 0708 release will be maintained in the MOSS-VL project resources.
97
 
98
  ## Quickstart
99
 
@@ -115,7 +117,7 @@ pip install -i https://pypi.org/simple --no-build-isolation -r requirements.txt
115
  import torch
116
  from transformers import AutoModelForCausalLM, AutoProcessor
117
 
118
- checkpoint = "OpenMOSS-Team/MOSS-VL-Realtime-0708"
119
 
120
  processor = AutoProcessor.from_pretrained(
121
  checkpoint,
@@ -177,8 +179,13 @@ try:
177
 
178
  session.push_prompt("What changed in the latest frames?")
179
 
180
- for chunk in session.stream_outputs(poll_interval=0.1):
181
- print(chunk, end="", flush=True)
 
 
 
 
 
182
  finally:
183
  session.close()
184
  ```
@@ -231,9 +238,13 @@ worker.join()
231
 
232
  Each queue item can contain `frame` or `image`, `timestamp`, `prompt`, `frames`, `event`, `events`, `initial_prompt`, `system_prompt`, `generate_kwargs`, `reset_session`, or stop controls such as `stop_online_generate`.
233
 
 
 
 
 
234
  ### Offline Inference Compatibility
235
 
236
- MOSS-VL-Realtime-0708 also keeps the offline helper APIs for image and video prompts. For purely offline use, MOSS-VL-Instruct-0708 is usually the preferred checkpoint, but the realtime checkpoint can still process complete image and video inputs.
237
 
238
  <details>
239
  <summary><b>Single-video Offline Inference</b></summary>
@@ -334,15 +345,15 @@ print(texts)
334
 
335
  | Model | Parameters | Context | Usage | Hugging Face |
336
  | --- | ---: | ---: | --- | --- |
337
- | MOSS-VL-Realtime-0708 | 11B | 256K | Realtime streaming video interaction | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Realtime-0708 |
338
- | MOSS-VL-Instruct-0708 | 11B | 256K | Offline multimodal instruction following | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Instruct-0708 |
339
- | MOSS-VL-Base-0708 | 11B | 256K | Continued pretraining and fine-tuning | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Base-0708 |
340
  | MOSS-VL-Instruct-0408 | 11B | 256K | Previous instruction-tuned checkpoint | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Instruct-0408 |
341
  | MOSS-VL-Base-0408 | 11B | 256K | Previous base checkpoint | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Base-0408 |
342
 
343
  ## Limitations and Future Work
344
 
345
- MOSS-VL-Realtime-0708 is optimized for timestamped frame-by-frame streaming, but production latency depends on GPU hardware, frame sampling rate, transport overhead, and decoding speed. One model instance supports one active realtime session. The default frame queue bounds latency by dropping older pending frames when needed.
346
 
347
  The model may emit realtime control tokens such as `<|silence|>`, `<|round_start|>`, and `<|round_end|>` depending on the application protocol. Downstream services should filter or render these tokens according to their UI needs.
348
 
 
4
  - en
5
  library_name: transformers
6
  pipeline_tag: video-text-to-text
7
+ base_model: OpenMOSS-Team/MOSS-VL-Base
8
  tags:
9
  - moss_vl
10
  - feature-extraction
 
24
  <img src="assets/logo.png" width="300" alt="MOSS-VL"/>
25
  </p>
26
 
27
+ # MOSS-VL-Realtime
28
 
29
  ## Introduction
30
 
31
+ MOSS-VL-Realtime is the realtime streaming checkpoint of the MOSS-VL release, part of the OpenMOSS ecosystem for open visual understanding.
32
 
33
+ Unlike offline video-language models that first read a complete video and then answer, MOSS-VL-Realtime is designed for continuous video streams. It can perceive incoming frames and generate text in parallel, support multi-turn realtime interaction, answer questions at arbitrary moments in the stream, and decide whether to speak or keep observing when the visual evidence is not yet sufficient.
34
 
35
+ This release keeps the MOSS-VL cross-attention design and a 256K text context window while adding realtime streaming data and an inference interface for timestamped frame-by-frame input.
36
 
37
  ## Highlights
38
 
 
40
  - Proactive silence: the model can emit `<|silence|>` and continue observing when no important visual event has happened or the context is insufficient.
41
  - Dynamic correction: as new frames arrive, the model can update or correct earlier responses instead of being locked to an initial interpretation.
42
  - Native timestamped frames: each streamed frame is associated with an absolute timestamp, helping the model reason about event order, duration, pacing, and fine-grained temporal localization.
43
+ - Open MOSS-VL family: released together with MOSS-VL-Instruct and MOSS-VL-Base for offline use, continued pretraining, fine-tuning, and applied research.
44
 
45
  ## Realtime Interaction
46
 
47
+ MOSS-VL-Realtime exposes a model-owned streaming loop through `create_realtime_session(...)`, `online_generate(...)`, and `real_time_generate(...)`. Applications should normally use `create_realtime_session(...)` for direct session control or `online_generate(...)` for queue-based backends.
48
 
49
  The recommended deployment API is `create_realtime_session(...)`. A service or application owns the video capture pipeline, converts camera, screen, or video-file input into PIL-compatible frames, and pushes each frame with a non-decreasing timestamp:
50
 
 
53
  - `session.push_prompt_frame(prompt, image, timestamp=...)` aligns a prompt with a specific frame.
54
  - `session.poll_output(...)` or `session.stream_outputs(...)` returns incremental text chunks.
55
 
56
+ `system_prompt` and `initial_prompt` are tokenized as the initial system/user turns before the first frame arrives. Subsequent user turns can be appended with `push_prompt(...)` while the same session continues observing frames.
57
+
58
  For backend systems that already use queues, `online_generate(...)` accepts dictionaries containing frames, prompts, events, reset controls, and stop controls.
59
 
60
  ## Model Architecture
61
 
62
+ MOSS-VL-Realtime adopts a cross-attention-based vision-language architecture that decouples visual encoding from language reasoning. This design is important for realtime usage because incoming visual content can be integrated into the running generation context without forcing the model into a strictly offline "load all frames, then answer" workflow.
63
 
64
  <p align="center">
65
  <img src="assets/architecture.png" alt="MOSS-VL Architecture" width="100%"/>
 
89
 
90
  ## Model Performance
91
 
92
+ MOSS-VL-Realtime is designed for streaming video understanding benchmarks where questions can arrive before a full video has been observed and correct answers may change as the scene evolves. It targets realtime interaction quality, proactive silence, and dynamic response updates in addition to standard video understanding accuracy.
93
 
94
  <p align="center">
95
  <img src="assets/benchmark-streaming.png" alt="MOSS-VL Streaming Benchmark" width="100%"/>
96
  </p>
97
 
98
+ Detailed benchmark tables and comparisons for this release will be maintained in the MOSS-VL project resources.
99
 
100
  ## Quickstart
101
 
 
117
  import torch
118
  from transformers import AutoModelForCausalLM, AutoProcessor
119
 
120
+ checkpoint = "OpenMOSS-Team/MOSS-VL-Realtime"
121
 
122
  processor = AutoProcessor.from_pretrained(
123
  checkpoint,
 
179
 
180
  session.push_prompt("What changed in the latest frames?")
181
 
182
+ # Realtime sessions stay alive waiting for future input, so use a bounded
183
+ # drain window and close the session explicitly when the producer is done.
184
+ drain_deadline = time.monotonic() + 5.0
185
+ while time.monotonic() < drain_deadline:
186
+ chunk = session.poll_output(timeout=0.1)
187
+ if chunk is not None:
188
+ print(chunk, end="", flush=True)
189
  finally:
190
  session.close()
191
  ```
 
238
 
239
  Each queue item can contain `frame` or `image`, `timestamp`, `prompt`, `frames`, `event`, `events`, `initial_prompt`, `system_prompt`, `generate_kwargs`, `reset_session`, or stop controls such as `stop_online_generate`.
240
 
241
+ ### Realtime Inference Package
242
+
243
+ The release bundle includes `../realtime_inference/run_online_inference.py`. It provides command-line video replay, camera and screen sources, training-format JSONL input, and a FastAPI WebSocket service built on the model APIs above. See `../realtime_inference/README.md` for deployment commands and the WebSocket protocol.
244
+
245
  ### Offline Inference Compatibility
246
 
247
+ MOSS-VL-Realtime also keeps the offline helper APIs for image and video prompts. For purely offline use, MOSS-VL-Instruct is usually the preferred checkpoint, but the realtime checkpoint can still process complete image and video inputs.
248
 
249
  <details>
250
  <summary><b>Single-video Offline Inference</b></summary>
 
345
 
346
  | Model | Parameters | Context | Usage | Hugging Face |
347
  | --- | ---: | ---: | --- | --- |
348
+ | MOSS-VL-Realtime | 11B | 256K | Realtime streaming video interaction | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Realtime |
349
+ | MOSS-VL-Instruct | 11B | 256K | Offline multimodal instruction following | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Instruct |
350
+ | MOSS-VL-Base | 11B | 256K | Continued pretraining and fine-tuning | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Base |
351
  | MOSS-VL-Instruct-0408 | 11B | 256K | Previous instruction-tuned checkpoint | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Instruct-0408 |
352
  | MOSS-VL-Base-0408 | 11B | 256K | Previous base checkpoint | https://huggingface.co/OpenMOSS-Team/MOSS-VL-Base-0408 |
353
 
354
  ## Limitations and Future Work
355
 
356
+ MOSS-VL-Realtime is optimized for timestamped frame-by-frame streaming, but production latency depends on GPU hardware, frame sampling rate, transport overhead, and decoding speed. One model instance supports one active realtime session. The default frame queue bounds latency by dropping older pending frames when needed.
357
 
358
  The model may emit realtime control tokens such as `<|silence|>`, `<|round_start|>`, and `<|round_end|>` depending on the application protocol. Downstream services should filter or render these tokens according to their UI needs.
359