Audio-Text-to-Text
Transformers
Safetensors
English
Chinese
moss_transcribe_diarize
text2text-generation
moss
audio
speech
asr
diarization
timestamp-asr
long-form-audio
multimodal
multilingual
custom_code
Eval Results
Run this model with HF Jobs
Run OpenMOSS-Team/MOSS-Transcribe-Diarize on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OpenMOSS-Team/MOSS-Transcribe-Diarize. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenMOSS-Team/MOSS-Transcribe-Diarize on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenMOSS-Team/MOSS-Transcribe-Diarize with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/MOSS-Transcribe-Diarize with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OpenMOSS-Team/MOSS-Transcribe-Diarize", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("OpenMOSS-Team/MOSS-Transcribe-Diarize", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
ef88c28
1
Parent(s): 7f2c1bd
Update README.md (#11)
Browse files- Update README.md (01c6b4bce432391e72dad29f0991e377b88f11b0)
Co-authored-by: zhaochenyang20 <zhaochenyang20@users.noreply.huggingface.co>
38 unmodified lines39404142434445464748113 unmodified lines16216316416516616716880 unmodified lines24925025125225325425525625721 unmodified lines27928028128228328428528628728828929029129229329429529629729829930030130230338 unmodified lines- [Model Architecture](#model-architecture)- [Evaluation](#evaluation)- [Quickstart](#quickstart)- [Environment Setup](#environment-setup)- [Python Usage](#python-usage)- [Custom Prompt and Hotwords](#custom-prompt-and-hotwords)- [Serve with vLLM and SGLang](#serve-with-vllm-and-sglang)- [Subtitle Web App](#subtitle-web-app)- [Output Format](#output-format)- [More Information](#more-information)113 unmodified lines## Quickstart### Environment SetupUse a clean Python environment. The model uses custom Transformers code, so load the model and processor with `trust_remote_code=True`.80 unmodified linesMore prompt recipes are available in the GitHub repository: <https://github.com/OpenMOSS/MOSS-Transcribe-Diarize/blob/main/examples/prompts.md>### Serve with vLLM and SGLangMOSS-Transcribe-Diarize supports vLLM serving through the OpenAI-compatible transcription API. Use a pinned vLLM nightly build that includes the MOSS-Transcribe-Diarize model registration. Choose one of the following commands: for CUDA 12 environments, use `cu129`; for CUDA 13 environments, use `cu130`.```bashuv pip install -U vllm \21 unmodified lines-F temperature="0"```The same request format can be used with an SGLang OpenAI-compatible server:```bashpython -m sglang.launch_server \--model-path OpenMOSS-Team/MOSS-Transcribe-Diarize \--served-model-name OpenMOSS-Team/MOSS-Transcribe-Diarize \--trust-remote-code \--host 0.0.0.0 \--port 30000``````bashcurl http://localhost:30000/v1/audio/transcriptions \-F model="OpenMOSS-Team/MOSS-Transcribe-Diarize" \-F file=@"audio.wav" \-F response_format="json" \-F temperature="0"```### Subtitle Web AppThe source package includes a local subtitle workflow for upload, review, subtitle export, and optional FFmpeg burn-in:38 unmodified lines3940414243444546474849113 unmodified lines16316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324480 unmodified lines32532632732832933033133233333421 unmodified lines35635735835936036138 unmodified lines- [Model Architecture](#model-architecture)- [Evaluation](#evaluation)- [Quickstart](#quickstart)- [Serve with SGLang Omni](#serve-with-sglang-omni)- [Serving with Hugging Face](#serving-with-native-hugging-face-transformers)- [Python Usage](#python-usage)- [Custom Prompt and Hotwords](#custom-prompt-and-hotwords)- [Serve with vLLM](#serve-with-vllm)- [Subtitle Web App](#subtitle-web-app)- [Output Format](#output-format)- [More Information](#more-information)113 unmodified lines## Quickstart### Serve with SGLang OmniThe recommended way to serve MOSS-Transcribe-Diarize is [SGLang Omni](https://github.com/sgl-project/sglang-omni) through the OpenAI-compatible `/v1/audio/transcriptions` endpoint. Install `sglang-omni` by following the [Installation guide](https://github.com/sgl-project/sglang-omni/blob/main/docs/get_started/installation.md), then download the model:```bashhf download OpenMOSS-Team/MOSS-Transcribe-Diarize```Serve the model:```bashsgl-omni serve \--model-path OpenMOSS-Team/MOSS-Transcribe-Diarize \--port 8000 \--max-running-requests 16 \--cuda-graph-max-bs 16 \--mem-fraction-static 0.80```Use `response_format=verbose_json` when you need parsed speaker segments. `json` returns the raw transcript text only.```bashcurl -X POST http://localhost:8000/v1/audio/transcriptions \-F model=OpenMOSS-Team/MOSS-Transcribe-Diarize \-F file=@audio.wav \-F response_format=verbose_json``````pythonimport requestswith open("audio.wav", "rb") as f:resp = requests.post("http://localhost:8000/v1/audio/transcriptions",data={"model": "OpenMOSS-Team/MOSS-Transcribe-Diarize","response_format": "verbose_json",},files={"file": ("audio.wav", f, "audio/wav")},timeout=300,)resp.raise_for_status()payload = resp.json()print(payload["text"])for segment in payload.get("segments", []):print(f"[{segment['start']:.2f}-{segment['end']:.2f}] {segment['text']}")```For longer multi-speaker audio, raise `max_new_tokens` so the decoder can finish the full diarized transcript:```bashcurl -X POST http://localhost:8000/v1/audio/transcriptions \-F model=OpenMOSS-Team/MOSS-Transcribe-Diarize \-F file=@audio.wav \-F response_format=verbose_json \-F max_new_tokens=65536```| Parameter | Type | Default | Description ||---|---|---|---|| `file` | file | required | Audio file uploaded as multipart form data || `model` | string | server default | Model identifier || `language` | string | unset | Optional language hint || `response_format` | string | `json` | `json`, `verbose_json`, or `text` || `temperature` | float | model default (`0.0`) | Sampling temperature || `max_new_tokens` | int | `5120` | Max generated tokens; raise for long audio (e.g. `65536`) || `prompt` | string | unset | Optional instruction override; omit to use the built-in transcribe+diarize prompt |`verbose_json` parses the model markup into OpenAI-style `segments` with `start`, `end`, and speaker-prefixed `text` (for example `[S01]...`). `json` / `text` return the full transcript string without segment parsing.For benchmarking, performance numbers, and more details, see the [SGLang Omni cookbook](https://github.com/sgl-project/sglang-omni/blob/main/docs/cookbook/moss_transcribe_diarize.md).### Serving with Native Hugging Face TransformersUse a clean Python environment. The model uses custom Transformers code, so load the model and processor with `trust_remote_code=True`.80 unmodified linesMore prompt recipes are available in the GitHub repository: <https://github.com/OpenMOSS/MOSS-Transcribe-Diarize/blob/main/examples/prompts.md>### Serve with vLLMMOSS-Transcribe-Diarize also supports vLLM serving through the OpenAI-compatible transcription API. Use a pinned vLLM nightly build that includes the MOSS-Transcribe-Diarize model registration. Choose one of the following commands: for CUDA 12 environments, use `cu129`; for CUDA 13 environments, use `cu130`.```bashuv pip install -U vllm \21 unmodified lines-F temperature="0"```### Subtitle Web AppThe source package includes a local subtitle workflow for upload, review, subtitle export, and optional FFmpeg burn-in:
README.md+82-24