Skip to content

Commit 872e649

Browse files
authored
Merge pull request #265 from ahmetoner/fix-faster-whisper-json
Fix JSON serialization of segments due to Faster Whisper v1.1.0 changes
2 parents 74bf823 + 229e155 commit 872e649

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Changelog
44
Unreleased
55
----------
66

7+
### Fixed
8+
9+
- Fix JSON serialization of segments due to Faster Whisper v1.1.0 changes
10+
711
[1.7.0] (2024-12-17)
812
--------------------
913

Diff for: app/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import os
3+
from dataclasses import asdict
34
from typing import TextIO, BinaryIO
45

56
import ffmpeg
@@ -88,6 +89,8 @@ class WriteJSON(ResultWriter):
8889
extension: str = "json"
8990

9091
def write_result(self, result: dict, file: TextIO):
92+
if "segments" in result:
93+
result["segments"] = [asdict(segment) for segment in result["segments"]]
9194
json.dump(result, file)
9295

9396

0 commit comments

Comments
 (0)