huggingface / huggingface/candle

Whisper outputs repeating sentences

Open
#1,422 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
21.1k
Forks
1.8k
Avg merge
16h 42m
Merged PRs (30d)
25

Description

A similar [issue](https://github.com/huggingface/candle/issues/472) was raised just a few months ago, but seems it's still not fully solved now.

[failed_audios.zip](https://github.com/huggingface/candle/files/13629198/failed_audios.zip)

I've attached some audio samples in this issue to help our discussion, now `candle`'s whisper outputs repeating sentences (sometimes even incomplete words) when the audio file reaches 30s, here are the outputs for the three audio samples I attached:

(Repeat `a little bit of`, and trailing `.`)
```text
# cargo run --example whisper --release --features=cuda -- --input=prodrecall_call.wav --timestamps
Compiling candle-examples v0.3.1 (/workspaces/candle/candle-examples)
Finished release [optimized] target(s) in 5.61s
Running `target/release/examples/whisper --input=prodrecall_call.wav --timestamps`
loaded wav data: Header { audio_format: 1, channel_count: 1, sampling_rate: 16000, bytes_per_second: 32000, bytes_per_sample: 2, bits_per_sample: 16 }
pcm data loaded 1913152
loaded mel: [1, 80, 13500]
0.0s -- 30.0s
0.0s-...: . I'm sorry. I can definitely help you with that. What is your first and last name? Sure. Steve Simmons. Okay. Can you spell that for me? S. P. E. V. E. Last name is
30.0s -- 60.0s
0.0s-...: .com. Okay. Can I also have your email address? Sure. It's Steve Simmons, just like it's spelled at gmail.com. Okay. I have Steve Simmons, S-P-E-V-E-S-I-M-M-O-N-S at tmail.com. Yes. Okay. Great. I'm going to have a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little bit of a little
60.0s -- 90.0s
0.0s-...: . I have located UNR system and you purchased the model number 23087, which has been recalled. I'm going to email you a pre-page shipping label to send back the recalled blender and we will be mailing you our latest model. Oh, thank you very much. So, go on the system and I just have your mailing address. Sure, it's 800 North Henderson Road in King of Prussia, Pennsylvania and the zip is one nine four of cents. Okay. I have a
90.0s -- 120.0s
0.0s-...: . I'm going to take the new blender. So you can expect your new blender to arrive in about four to six business fees. Oh great. Thank you very much. No problem. Is there anything else I could help you with today? No, that's all I needed, but thank you. Thank you. Have a nice day. You too. Bye bye.
120.0s -- 135.0s
0.0s-...: .
```

(Repeat `I'm so sorry to hear that`, and trailing `.com` comes from nowhere)
```text
# cargo run --example whisper --release --features=cuda -- --input=long_test.wav --timestamps
Finished release [optimized] target(s) in 0.22s
Running `target/release/examples/whisper --input=long_test.wav --timestamps`
loaded wav data: Header { audio_format: 1, channel_count: 1, sampling_rate: 16000, bytes_per_second: 32000, bytes_per_sample: 2, bits_per_sample: 16 }
pcm data loaded 1081864
loaded mel: [1, 80, 9000]
0.0s -- 30.0s
0.0s-...: . Hi, this is Jason. How can I help you this afternoon? You tell me I'm looking at my new statement and I see that you people have charged me again for the same fees I've been calling about for months now. I'm sick and tired of being told that it's handled one pretty clearly it's not. I'm so sorry to hear that. Let me take a look at your account and find out what's going on. Can you remind me when this started? I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to hear that. I'm so sorry to
30.0s -- 60.0s
0.0s-...: . I completely understand your frustration. Let me see what I can do to help get this taken care of for you right now. I'm glad I was able to get that issue taken care of. It may take up to 24 hours for your account to show the changes, but you shouldn't see any more of these fees in the future. Thanks for working with me to figure it out. I want to apologize again for the inconvenience. Thanks Jason, I appreciate your help.
60.0s -- 90.0s
0.0s-...: .com
```

(Repeat `I think that's a good idea.`)
```text
# cargo run --example whisper --release --features=cuda -- --input=G437-1-segment.wav --timestamps
Finished release [optimized] target(s) in 0.22s
Running `target/release/examples/whisper --input=G437-1-segment.wav --timestamps`
loaded wav data: Header { audio_format: 1, channel_count: 1, sampling_rate: 16000, bytes_per_second: 32000, bytes_per_sample: 2, bits_per_sample: 16 }
pcm data loaded 1911376
loaded mel: [1, 80, 13500]
0.0s -- 30.0s
0.0s-29.0s: . Okay, so there's two times. The most common one is when you go through a yellow light just about to turn red or maybe did turn red, you tap the roof of your car and you're safe. I don't know. And then the second one is if you're speeding or you're just being a bad person and you see a cop and for whatever reason the cop is a bad thing for you, you tap the roof of your car and everybody in the car has to tap the roof of the car.
30.0s -- 60.0s
0.0s-...: . I don't do it because I think it's stupid. But my friends have done it and maybe is that just a Colorado thing or something? I don't know. I could just be me. I just haven't done it. Well leave a comment below if you've ever heard of this one before. Dropping on the floor, Michael. Okay. So yeah, what's on your
60.0s -- 90.0s
0.0s-...: . I also have a theory about this one. The theory about this one is the time frame, the seven year time frame that's the sign that's breaking a mirror. Because, and I could be totally wrong on this, but my theory is that if you break a mirror, a mirror is glass, a mirror, you know, it's a shatter into, you know, millions of pieces. And maybe it's hard to find all of the pieces, maybe cleaning the mess of going to be difficult. So, I think that's a really good idea. I think that's a really good idea. I think that's a really good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's a good idea. I think that's
90.0s -- 120.0s
0.0s-...: . And then when you tell every night's glass and you're like, see you told yourself. I don't know, that's my theory on that one. But again, I think this is another instant, instant bad luck one. As soon as you break the mirror, you know, to clean it up, somebody could get cut, whatever.
120.0s -- 135.0s
```

I've been struggling with this bug for a long time and I'm still not sure how to fix it. I'd appreciate it if you can give me some suggestions.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `whisper` example and reproduce the behavior using the attached audio samples and the shown CUDA commands. Compare the 30-second segments and their timestamps; done means long recordings no longer produce repeated or unrelated text at segment boundaries.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.