Update app.py
Browse files
app.py
CHANGED
|
@@ -125,7 +125,7 @@ def unwrap_diarization(result):
|
|
| 125 |
if hasattr(result, "itertracks"):
|
| 126 |
return result
|
| 127 |
# Attribute-basiert (DiarizeOutput, SlidingWindowFeature, ...)
|
| 128 |
-
for attr in ("diarization", "annotation", "output"):
|
| 129 |
val = getattr(result, attr, None)
|
| 130 |
if val is not None and hasattr(val, "itertracks"):
|
| 131 |
return val
|
|
@@ -196,9 +196,6 @@ def run_pipeline(audio_array, sample_rate, model_key, use_diar):
|
|
| 196 |
diar_input = {"waveform": waveform, "sample_rate": sample_rate}
|
| 197 |
diar = get_diar(device)
|
| 198 |
diarization = diar(diar_input)
|
| 199 |
-
# Debug: zeigt den echten Typ im HF-Log
|
| 200 |
-
print(f"[DEBUG] diarization type: {type(diarization)}")
|
| 201 |
-
print(f"[DEBUG] attrs: {[a for a in dir(diarization) if not a.startswith('_')]}")
|
| 202 |
segments = merge_with_speakers(chunks, diarization)
|
| 203 |
labeled = format_diarized(segments)
|
| 204 |
return raw_transcript, labeled or "(Keine Sprecher erkannt.)"
|
|
@@ -344,7 +341,7 @@ with gr.Blocks(title="Yapper - Meeting Transcriber") as demo:
|
|
| 344 |
<div class="icon">🎙️</div>
|
| 345 |
<div>
|
| 346 |
<h1 style="margin:0;font-size:1.7rem;font-weight:700;color:#ffffff;letter-spacing:-.3px;">Yapper</h1>
|
| 347 |
-
<
|
| 348 |
</div>
|
| 349 |
<div class="badge">⚡ ZeroGPU</div>
|
| 350 |
</div>
|
|
|
|
| 125 |
if hasattr(result, "itertracks"):
|
| 126 |
return result
|
| 127 |
# Attribute-basiert (DiarizeOutput, SlidingWindowFeature, ...)
|
| 128 |
+
for attr in ("speaker_diarization", "exclusive_speaker_diarization", "diarization", "annotation", "output"):
|
| 129 |
val = getattr(result, attr, None)
|
| 130 |
if val is not None and hasattr(val, "itertracks"):
|
| 131 |
return val
|
|
|
|
| 196 |
diar_input = {"waveform": waveform, "sample_rate": sample_rate}
|
| 197 |
diar = get_diar(device)
|
| 198 |
diarization = diar(diar_input)
|
|
|
|
|
|
|
|
|
|
| 199 |
segments = merge_with_speakers(chunks, diarization)
|
| 200 |
labeled = format_diarized(segments)
|
| 201 |
return raw_transcript, labeled or "(Keine Sprecher erkannt.)"
|
|
|
|
| 341 |
<div class="icon">🎙️</div>
|
| 342 |
<div>
|
| 343 |
<h1 style="margin:0;font-size:1.7rem;font-weight:700;color:#ffffff;letter-spacing:-.3px;">Yapper</h1>
|
| 344 |
+
<h3 style="margin:4px 0 0;font-size:.87rem;color:#ffffff;opacity:.9;">Transkription & Speaker-Diarisierung · für Teams-Meetings</h3>
|
| 345 |
</div>
|
| 346 |
<div class="badge">⚡ ZeroGPU</div>
|
| 347 |
</div>
|