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
55e4b488
Commit
55e4b488
authored
Oct 1, 2023
by
Ahmet Öner
Browse files
Options
Downloads
Patches
Plain Diff
Enable world level timestamps for OpenAI Whisper
parent
986a18af
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-1
1 addition, 1 deletion
CHANGELOG.md
app/openai_whisper/core.py
+2
-0
2 additions, 0 deletions
app/openai_whisper/core.py
app/webservice.py
+1
-5
1 addition, 5 deletions
app/webservice.py
with
4 additions
and
6 deletions
CHANGELOG.md
+
1
−
1
View file @
55e4b488
...
@@ -11,7 +11,7 @@ Unreleased
...
@@ -11,7 +11,7 @@ Unreleased
### Changed
### Changed
-
Upgraded
-
Upgraded
-
O
pen
AI W
hisper to v20230918
-
[
o
pen
ai/w
hisper
](
https://github.com/openai/whisper
)
to
[
v20230918
](
https://github.com/openai/whisper/releases/tag/v20230918
)
[1.1.1] (2023-05-29)
[1.1.1] (2023-05-29)
--------------------
--------------------
...
...
...
...
This diff is collapsed.
Click to expand it.
app/openai_whisper/core.py
+
2
−
0
View file @
55e4b488
...
@@ -28,6 +28,8 @@ def transcribe(
...
@@ -28,6 +28,8 @@ def transcribe(
options_dict
[
"
language
"
]
=
language
options_dict
[
"
language
"
]
=
language
if
initial_prompt
:
if
initial_prompt
:
options_dict
[
"
initial_prompt
"
]
=
initial_prompt
options_dict
[
"
initial_prompt
"
]
=
initial_prompt
if
word_timestamps
:
options_dict
[
"
word_timestamps
"
]
=
word_timestamps
with
model_lock
:
with
model_lock
:
result
=
model
.
transcribe
(
audio
,
**
options_dict
)
result
=
model
.
transcribe
(
audio
,
**
options_dict
)
...
...
...
...
This diff is collapsed.
Click to expand it.
app/webservice.py
+
1
−
5
View file @
55e4b488
...
@@ -66,11 +66,7 @@ async def asr(
...
@@ -66,11 +66,7 @@ async def asr(
audio_file
:
UploadFile
=
File
(...),
audio_file
:
UploadFile
=
File
(...),
encode
:
bool
=
Query
(
default
=
True
,
description
=
"
Encode audio first through ffmpeg
"
),
encode
:
bool
=
Query
(
default
=
True
,
description
=
"
Encode audio first through ffmpeg
"
),
output
:
Union
[
str
,
None
]
=
Query
(
default
=
"
txt
"
,
enum
=
[
"
txt
"
,
"
vtt
"
,
"
srt
"
,
"
tsv
"
,
"
json
"
]),
output
:
Union
[
str
,
None
]
=
Query
(
default
=
"
txt
"
,
enum
=
[
"
txt
"
,
"
vtt
"
,
"
srt
"
,
"
tsv
"
,
"
json
"
]),
word_timestamps
:
bool
=
Query
(
word_timestamps
:
bool
=
Query
(
default
=
False
,
description
=
"
World level timestamps
"
)
default
=
False
,
description
=
"
World level timestamps
"
,
include_in_schema
=
(
True
if
ASR_ENGINE
==
"
faster_whisper
"
else
False
)
)
):
):
result
=
transcribe
(
load_audio
(
audio_file
.
file
,
encode
),
task
,
language
,
initial_prompt
,
word_timestamps
,
output
)
result
=
transcribe
(
load_audio
(
audio_file
.
file
,
encode
),
task
,
language
,
initial_prompt
,
word_timestamps
,
output
)
return
StreamingResponse
(
return
StreamingResponse
(
...
...
...
...
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
sign in
to comment