Skip to content

Commit

Permalink
Merge pull request #61 from issacdowling/main
Browse files Browse the repository at this point in the history
Provide new_segment_callback with Segment, not list[Segment], fixing type hints
  • Loading branch information
absadiki authored Sep 25, 2024
2 parents 2d32f99 + 2cfc095 commit 3f0d207
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pywhispercpp/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ def __call_new_segment_callback(ctx, n_new, user_data) -> None:
n = pw.whisper_full_n_segments(ctx)
start = n - n_new
res = Model._get_segments(ctx, start, n)
Model._new_segment_callback(res)
for segment in res:
Model._new_segment_callback(segment)

@staticmethod
def _load_audio(media_file_path: str) -> np.array:
Expand Down

0 comments on commit 3f0d207

Please sign in to comment.