Zeitstempel werden alle 30 Sekunden zurückgesetzt, wenn Distil-Whisper mit return_timestamps = true verwendet wirdPython

Python-Programme
Anonymous
 Zeitstempel werden alle 30 Sekunden zurückgesetzt, wenn Distil-Whisper mit return_timestamps = true verwendet wird

Post by Anonymous »

Problem
diffil-large-v3#sequentiell-long-form
Ich verwende Distil-Whisper über die 🤗 Transformators Pipeline für die Spracherkennung. Beim Einstellen von return_timestamps = true werden die Zeitstempel alle 30 Sekunden auf 0 zurückgesetzt, anstatt in der gesamten Audio-Datei weiter zu steigen.pipe = pipeline(
"automatic-speech-recognition",
model=model,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
max_new_tokens=128,
torch_dtype=torch_dtype,
device=device,
return_timestamps=True,
)

result = pipe("audio.mp4")
< /code>
Ausgabe < /h2>
Die Zeitstempel in der Ausgabe sehen so aus: < /p>
{'chunks': [
{'text': 'First segment', 'timestamp': (0.0, 5.2)},
{'text': 'Second segment', 'timestamp': (5.2, 12.8)},
{'text': 'Later segment', 'timestamp': (28.4, 30.0)},
{'text': 'Should be ~35s but shows', 'timestamp': (0.0, 4.6)}, # Resets here!
...
]}
< /code>
Erwartete Verhalten < /h2>
Ich erwarte, dass die Zeitstempel über 30 Sekunden weiter inkrementieren, wie folgt: < /p>
{'chunks': [
{'text': 'First segment', 'timestamp': (0.0, 5.2)},
{'text': 'Second segment', 'timestamp': (5.2, 12.8)},
{'text': 'Later segment', 'timestamp': (28.4, 30.0)},
{'text': 'Continues properly', 'timestamp': (30.0, 34.6)}, # Should continue
...
]}
< /code>
Umgebung < /h2>

Python 3.10 < /li>
Transformers 4.36.2 < /li>
Torch 2.1.2 < /li>
model: distil-how-whisper-V3 < /li>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post