Skip to content
Snippets Groups Projects
Commit 9963d632 authored by Tanay Upadhyaya's avatar Tanay Upadhyaya
Browse files

Minor cleanup and added TODO comments

parent 9d8c9c21
No related branches found
No related tags found
No related merge requests found
...@@ -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
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 = '.'):
......
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment