Skip to content

Commit

Permalink
Fix #839 incorrect clip_timestamps being used in model (#842)
Browse files Browse the repository at this point in the history
* Fix #839

Changed the code from updating the TranscriptionOptions class instead of the options object which likely was the cause of unexpected behaviour
  • Loading branch information
nonnoxer authored May 17, 2024
1 parent a1c3583 commit 4acdb5c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,16 @@ def generate_segments(
content_duration = float(content_frames * self.feature_extractor.time_per_frame)

if isinstance(options.clip_timestamps, str):
TranscriptionOptions.clip_timestamps = [
float(ts)
for ts in (
options.clip_timestamps.split(",")
if options.clip_timestamps
else []
)
]
options = options._replace(
clip_timestamps=[
float(ts)
for ts in (
options.clip_timestamps.split(",")
if options.clip_timestamps
else []
)
]
)
seek_points: List[int] = [
round(ts * self.frames_per_second) for ts in options.clip_timestamps
]
Expand Down

0 comments on commit 4acdb5c

Please sign in to comment.