Update app.py
Browse files
app.py
CHANGED
|
@@ -120,6 +120,9 @@ def transcribe_audio(audio_16k, processor, model, device, dtype):
|
|
| 120 |
# ββ Speaker-Diarisierung βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 121 |
|
| 122 |
def merge_with_speakers(chunks, diarization):
|
|
|
|
|
|
|
|
|
|
| 123 |
merged = []
|
| 124 |
for chunk in chunks:
|
| 125 |
start, end = chunk["timestamp"]
|
|
@@ -226,8 +229,8 @@ body, .gradio-container {
|
|
| 226 |
color: #fff;
|
| 227 |
}
|
| 228 |
.yapper-header .icon { font-size: 2.8rem; line-height: 1; }
|
| 229 |
-
.yapper-header h1 { margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: -.3px; color: #fff; }
|
| 230 |
-
.yapper-header p { margin: 4px 0 0; font-size: .87rem; opacity: .
|
| 231 |
.yapper-header .badge {
|
| 232 |
margin-left: auto;
|
| 233 |
background: rgba(255,255,255,.2);
|
|
@@ -306,14 +309,14 @@ textarea {
|
|
| 306 |
|
| 307 |
# ββ UI ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 308 |
|
| 309 |
-
with gr.Blocks(title="Yapper - Meeting Transcriber"
|
| 310 |
|
| 311 |
gr.HTML("""
|
| 312 |
<div class="yapper-header">
|
| 313 |
<div class="icon">ποΈ</div>
|
| 314 |
<div>
|
| 315 |
-
<h1>Yapper</h1>
|
| 316 |
-
<p>Transkription & Speaker-Diarisierung · fΓΌr eure Teams-Meetings</p>
|
| 317 |
</div>
|
| 318 |
<div class="badge">⚡ ZeroGPU</div>
|
| 319 |
</div>
|
|
@@ -384,5 +387,4 @@ with gr.Blocks(title="Yapper - Meeting Transcriber", css=CSS) as demo:
|
|
| 384 |
outputs=[transcript_out, diar_out],
|
| 385 |
)
|
| 386 |
|
| 387 |
-
|
| 388 |
-
demo.launch()
|
|
|
|
| 120 |
# ββ Speaker-Diarisierung βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 121 |
|
| 122 |
def merge_with_speakers(chunks, diarization):
|
| 123 |
+
# pyannote >= 3.1 kann DiarizeOutput zurΓΌckgeben statt Annotation
|
| 124 |
+
if hasattr(diarization, "diarization"):
|
| 125 |
+
diarization = diarization.diarization
|
| 126 |
merged = []
|
| 127 |
for chunk in chunks:
|
| 128 |
start, end = chunk["timestamp"]
|
|
|
|
| 229 |
color: #fff;
|
| 230 |
}
|
| 231 |
.yapper-header .icon { font-size: 2.8rem; line-height: 1; }
|
| 232 |
+
.yapper-header h1 { margin: 0 !important; font-size: 1.7rem !important; font-weight: 700 !important; letter-spacing: -.3px !important; color: #fff !important; }
|
| 233 |
+
.yapper-header p { margin: 4px 0 0 !important; font-size: .87rem !important; opacity: .9 !important; color: #fff !important; }
|
| 234 |
.yapper-header .badge {
|
| 235 |
margin-left: auto;
|
| 236 |
background: rgba(255,255,255,.2);
|
|
|
|
| 309 |
|
| 310 |
# ββ UI ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 311 |
|
| 312 |
+
with gr.Blocks(title="Yapper - Meeting Transcriber") as demo:
|
| 313 |
|
| 314 |
gr.HTML("""
|
| 315 |
<div class="yapper-header">
|
| 316 |
<div class="icon">ποΈ</div>
|
| 317 |
<div>
|
| 318 |
+
<h1 style="margin:0;font-size:1.7rem;font-weight:700;color:#ffffff;letter-spacing:-.3px;">Yapper</h1>
|
| 319 |
+
<p style="margin:4px 0 0;font-size:.87rem;color:#ffffff;opacity:.9;">Transkription & Speaker-Diarisierung · fΓΌr eure Teams-Meetings</p>
|
| 320 |
</div>
|
| 321 |
<div class="badge">⚡ ZeroGPU</div>
|
| 322 |
</div>
|
|
|
|
| 387 |
outputs=[transcript_out, diar_out],
|
| 388 |
)
|
| 389 |
|
| 390 |
+
demo.launch(css=CSS)
|
|
|