abdeladim-s / pywhispercpp

Python bindings for whisper.cpp
https://abdeladim-s.github.io/pywhispercpp/
MIT License
180 stars 26 forks source link

Provide new_segment_callback with Segment, not list[Segment], fixing type hints #61

Closed issacdowling closed 1 month ago

issacdowling commented 2 months ago

In my editor, it's shown that new_segment_callback is to be provided a Segment, but it actually provides a list[Segment] with one element. I've changed this by just returning that first element so that it matches the type hints.

issacdowling commented 2 months ago

If it's a larger issue that this would break existing callbacks using the list of Segments, the type hint could just be switched to match, but providing one Segment rather than one Segment in a list seems better