Skip to content

Commit

Permalink
Added Cython dependency, rounding timestamps to 2 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleks committed Mar 30, 2024
1 parent d1fab11 commit 3f97042
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"Cython==3.0.10",
"deepmultilingualpunctuation==1.0.1",
"nemo_toolkit[asr]==1.23.0",
"tensorrt_llm==0.9.0.dev2024032600",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def __call__(
str(processed_audio_filepath),
num_speakers=oracle_num_speakers,
out_dir=temp_dir,
num_workers=1,
)

segments = self.convert_annotation_to_segments(annotation)
Expand Down
7 changes: 5 additions & 2 deletions src/wordcab_transcribe/services/transcribe_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ def __call__(

for ix, segment in enumerate(segments):
segment["words"] = segment.pop("word_timestamps")
segment["start"] = segment.pop("start_time")
segment["end"] = segment.pop("end_time")
for word in segment["words"]:
word["start"] = round(word["start"], 2)
word["end"] = round(word["end"], 2)
segment["start"] = round(segment.pop("start_time"), 2)
segment["end"] = round(segment.pop("end_time"), 2)
extra = {
"seek": 1,
"id": 1,
Expand Down

0 comments on commit 3f97042

Please sign in to comment.