Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
whisper-asr-webservice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schwertgen
whisper-asr-webservice
Commits
229e155c
Commit
229e155c
authored
7 months ago
by
Ahmet Öner
Browse files
Options
Downloads
Patches
Plain Diff
Fix JSON serialization of segments due to Faster Whisper v1.1.0 changes
parent
74bf823b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
app/utils.py
+3
-0
3 additions, 0 deletions
app/utils.py
with
7 additions
and
0 deletions
CHANGELOG.md
+
4
−
0
View file @
229e155c
...
@@ -4,6 +4,10 @@ Changelog
...
@@ -4,6 +4,10 @@ Changelog
Unreleased
Unreleased
----------
----------
### Fixed
-
Fix JSON serialization of segments due to Faster Whisper v1.1.0 changes
[1.7.0] (2024-12-17)
[1.7.0] (2024-12-17)
--------------------
--------------------
...
...
This diff is collapsed.
Click to expand it.
app/utils.py
+
3
−
0
View file @
229e155c
import
json
import
json
import
os
import
os
from
dataclasses
import
asdict
from
typing
import
TextIO
,
BinaryIO
from
typing
import
TextIO
,
BinaryIO
import
ffmpeg
import
ffmpeg
...
@@ -88,6 +89,8 @@ class WriteJSON(ResultWriter):
...
@@ -88,6 +89,8 @@ class WriteJSON(ResultWriter):
extension
:
str
=
"
json
"
extension
:
str
=
"
json
"
def
write_result
(
self
,
result
:
dict
,
file
:
TextIO
):
def
write_result
(
self
,
result
:
dict
,
file
:
TextIO
):
if
"
segments
"
in
result
:
result
[
"
segments
"
]
=
[
asdict
(
segment
)
for
segment
in
result
[
"
segments
"
]]
json
.
dump
(
result
,
file
)
json
.
dump
(
result
,
file
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment