Skip to content

Commit

Permalink
Minor cleanup and added TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alienware committed Mar 5, 2023
1 parent 9d8c9c2 commit 9963d63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ COPY . .
RUN poetry install
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
16 changes: 1 addition & 15 deletions app/faster_whisper/utils.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import json
import os
import sys
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
from typing import TextIO


def format_timestamp(seconds: float, always_include_hours: bool = False, decimal_marker: str = '.'):
Expand Down
1 change: 1 addition & 0 deletions model_conversion.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/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

0 comments on commit 9963d63

Please sign in to comment.