Audio-Text-to-Text
Transformers
Safetensors
English
Chinese
moss_transcribe_diarize
text-generation
moss
audio
speech
asr
diarization
timestamp-asr
long-form-audio
multimodal
multilingual
custom_code
Eval Results
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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OpenMOSS-Team/MOSS-Transcribe-Diarize", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update chat template with default prompt
#25
by itazap HF Staff - opened
- chat_template.jinja +12 -2
chat_template.jinja
CHANGED
|
@@ -2,13 +2,23 @@
|
|
| 2 |
{%- if content is string -%}
|
| 3 |
{{- content -}}
|
| 4 |
{%- else -%}
|
|
|
|
| 5 |
{%- for item in content -%}
|
| 6 |
{%- if item.type == 'audio' or 'audio' in item or 'audio_url' in item -%}
|
| 7 |
{{- '<|audio_start|><|audio_pad|><|audio_end|>\n' -}}
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
{%- endif -%}
|
| 11 |
{%- endfor -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
{%- endif -%}
|
| 13 |
{%- endmacro -%}
|
| 14 |
{%- if tools %}
|
|
|
|
| 2 |
{%- if content is string -%}
|
| 3 |
{{- content -}}
|
| 4 |
{%- else -%}
|
| 5 |
+
{%- set ns = namespace(has_audio=false, text=none) -%}
|
| 6 |
{%- for item in content -%}
|
| 7 |
{%- if item.type == 'audio' or 'audio' in item or 'audio_url' in item -%}
|
| 8 |
{{- '<|audio_start|><|audio_pad|><|audio_end|>\n' -}}
|
| 9 |
+
{%- set ns.has_audio = true -%}
|
| 10 |
+
{%- elif item.type == 'text' and ns.text is none -%}
|
| 11 |
+
{%- set ns.text = item.text -%}
|
| 12 |
{%- endif -%}
|
| 13 |
{%- endfor -%}
|
| 14 |
+
{%- if ns.has_audio -%}
|
| 15 |
+
{%- if ns.text -%}
|
| 16 |
+
{{- '补充信息:' + ns.text + '\n\n' -}}
|
| 17 |
+
{%- endif -%}
|
| 18 |
+
{{- '请将音频转写为文本,每一段需以起始时间戳和说话人编号([S01]、[S02]、[S03]…)开头,正文为对应的语音内容,并在段末标注结束时间戳,以清晰标明该段语音范围。' -}}
|
| 19 |
+
{%- elif ns.text -%}
|
| 20 |
+
{{- ns.text -}}
|
| 21 |
+
{%- endif -%}
|
| 22 |
{%- endif -%}
|
| 23 |
{%- endmacro -%}
|
| 24 |
{%- if tools %}
|