Video-Text-to-Text
Transformers
Safetensors
English
Chinese
moss_vl
feature-extraction
Realtime
Streaming
Video-Understanding
Image-Understanding
MOSS-VL
OpenMOSS
multimodal
video
vision-language
custom_code
Instructions to use OpenMOSS-Team/MOSS-VL-Realtime with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/MOSS-VL-Realtime with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenMOSS-Team/MOSS-VL-Realtime", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
fix: strip mid-string U+FFFD in realtime decode emit
Browse filesThe end-of-buffer guard only catches an INCOMPLETE
trailing multi-byte char. Under sampling, a char can also break MID-string
(the next token completes a different char, orphaning the first one's tail
bytes) and the replacement character then stays in the output text forever
(observed: mojibake in Chinese captions). Strip the unrecoverable broken char
at emit time. Platform-neutral.
- modeling_moss_vl.py +10 -1
modeling_moss_vl.py
CHANGED
|
@@ -3604,7 +3604,16 @@ class MossVLForConditionalGeneration(MossVLPreTrainedModel, GenerationMixin):
|
|
| 3604 |
and buf_list[-1] == invalid_token_id
|
| 3605 |
)
|
| 3606 |
if is_silence_or_ellipsis or is_complete_text or is_invalid_complete:
|
| 3607 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3608 |
token_buffer.clear()
|
| 3609 |
|
| 3610 |
input_ids = torch.cat([input_ids, next_tokens[:, None]], dim=-1)
|
|
|
|
| 3604 |
and buf_list[-1] == invalid_token_id
|
| 3605 |
)
|
| 3606 |
if is_silence_or_ellipsis or is_complete_text or is_invalid_complete:
|
| 3607 |
+
# The end-of-buffer guard above only catches an INCOMPLETE
|
| 3608 |
+
# trailing char. Under sampling, a multi-byte char can also
|
| 3609 |
+
# break MID-string (the next token completes a different
|
| 3610 |
+
# char, orphaning the first char's tail bytes) — the
|
| 3611 |
+
# replacement char then stays in the text forever. Those
|
| 3612 |
+
# bytes are unrecoverable at this point: drop the broken
|
| 3613 |
+
# character instead of emitting mojibake.
|
| 3614 |
+
clean_text = decoded_text.replace("\ufffd", "")
|
| 3615 |
+
if clean_text:
|
| 3616 |
+
output_text_queue.put(clean_text)
|
| 3617 |
token_buffer.clear()
|
| 3618 |
|
| 3619 |
input_ids = torch.cat([input_ids, next_tokens[:, None]], dim=-1)
|