Skip to content

Commit

Permalink
Merge pull request #199 from beeldengeluid/198-add-standard-log-forma…
Browse files Browse the repository at this point in the history
…t-to-whisper_api

added time to log messages
  • Loading branch information
greenw0lf authored Jan 16, 2025
2 parents 7a8b68d + e59e34b commit 5dc6720
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV POETRY_NO_INTERACTION=1 \

COPY ./poetry.lock ./poetry.lock
COPY ./pyproject.toml ./pyproject.toml
RUN poetry self add poetry-plugin-export
RUN poetry self add poetry-plugin-export==1.8.0
RUN poetry export --format requirements.txt --output requirements.txt

FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04
Expand Down
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ def run_api(port: int):
from whisper_api import api
import uvicorn

log_config = uvicorn.config.LOGGING_CONFIG
log_config["formatters"]["default"]["fmt"] = LOG_FORMAT

logger.info("Running Whisper as a service")
uvicorn.run(api, port=port, host="0.0.0.0")
uvicorn.run(api, port=port, host="0.0.0.0", log_config=log_config)


def run_job(input_uri: str, output_uri: str):
Expand Down
1 change: 1 addition & 0 deletions whisper_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
w_model,
)


logger = logging.getLogger(__name__)
api = FastAPI()

Expand Down

0 comments on commit 5dc6720

Please sign in to comment.