jianfch / stable-ts

Transcription, forced alignment, and audio indexing with OpenAI's Whisper
MIT License
1.59k stars 177 forks source link

Question about this line of code #241

Closed axionbuster closed 1 year ago

axionbuster commented 1 year ago

https://github.com/jianfch/stable-ts/blame/3dfbd722a8edb606a2d819fee49ff9c5db4bf0f2/stable_whisper/result.py#L870

    def _split_segments(self, get_indices, args: list = None, *, lock: bool = False):
        if args is None:
            args = []
        no_words = False
        for i in reversed(range(0, len(self.segments))):
            no_words = not self.segments[i].has_words # <-- here
            indices = get_indices(self.segments[i], *args)
            if indices:

I was skimming through the code.

Was this line supposed to be a series disjunction like this?

# no_words = not self.segments[i].has_words
no_words = no_words or not self.segments[i].has_words
jianfch commented 1 year ago

Yes. Thanks for pointing that out.