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
9963d632
Commit
9963d632
authored
Mar 5, 2023
by
Tanay Upadhyaya
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup and added TODO comments
parent
9d8c9c21
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
Dockerfile.gpu
+1
-1
1 addition, 1 deletion
Dockerfile.gpu
app/faster_whisper/utils.py
+1
-15
1 addition, 15 deletions
app/faster_whisper/utils.py
model_conversion.sh
+1
-0
1 addition, 0 deletions
model_conversion.sh
with
3 additions
and
16 deletions
Dockerfile.gpu
+
1
−
1
View file @
9963d632
...
@@ -34,4 +34,4 @@ COPY . .
...
@@ -34,4 +34,4 @@ COPY . .
RUN poetry install
RUN poetry install
RUN $POETRY_VENV/bin/pip install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/torch
RUN $POETRY_VENV/bin/pip install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/torch
CMD
PYTHONUNBUFFERED=TRUE
gunicorn --bind 0.0.0.0:9000 --workers 1 --timeout 0 app.webservice:app -k uvicorn.workers.UvicornWorker
CMD gunicorn --bind 0.0.0.0:9000 --workers 1 --timeout 0 app.webservice:app -k uvicorn.workers.UvicornWorker
This diff is collapsed.
Click to expand it.
app/faster_whisper/utils.py
+
1
−
15
View file @
9963d632
import
json
import
json
import
os
import
os
import
sys
from
typing
import
TextIO
import
zlib
from
typing
import
Callable
,
TextIO
system_encoding
=
sys
.
getdefaultencoding
()
if
system_encoding
!=
"
utf-8
"
:
def
make_safe
(
string
):
# replaces any character not representable using the system default encoding with an '?',
# avoiding UnicodeEncodeError (https://github.com/openai/whisper/discussions/729).
return
string
.
encode
(
system_encoding
,
errors
=
"
replace
"
).
decode
(
system_encoding
)
else
:
def
make_safe
(
string
):
# utf-8 can encode any Unicode code point, so no need to do the round-trip encoding
return
string
def
format_timestamp
(
seconds
:
float
,
always_include_hours
:
bool
=
False
,
decimal_marker
:
str
=
'
.
'
):
def
format_timestamp
(
seconds
:
float
,
always_include_hours
:
bool
=
False
,
decimal_marker
:
str
=
'
.
'
):
...
...
This diff is collapsed.
Click to expand it.
model_conversion.sh
+
1
−
0
View file @
9963d632
#!/bin/bash
#!/bin/bash
# TODO: Add step to build setup based on ENV variable
ct2-transformers-converter
--model
openai/whisper-large-v2
--output_dir
/root/.cache/faster_whisper
--quantization
float16
ct2-transformers-converter
--model
openai/whisper-large-v2
--output_dir
/root/.cache/faster_whisper
--quantization
float16
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