mirror of
https://github.com/openai/whisper.git
synced 2025-11-28 08:11:11 +00:00
Hiding the ffmpeg popup that appears momentarily
On Windows there is a problem due to which FFMPEG running in the background becomes small for a second during startup. Context: "Whisper" is used in conjunction with FastAPI and uvicorn. The service is started using pm2. The problem does not exist if you run it manually from a regular console using "python main.py" Demonstration of the problem before and after https://youtu.be/IsEavmzQOv8
This commit is contained in:
parent
ba3f3cd54b
commit
4fda47955b
@ -1,6 +1,6 @@
|
||||
import os
|
||||
from functools import lru_cache
|
||||
from subprocess import CalledProcessError, run
|
||||
from subprocess import CalledProcessError, run, CREATE_NO_WINDOW
|
||||
from typing import Optional, Union
|
||||
|
||||
import numpy as np
|
||||
@ -55,7 +55,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE):
|
||||
]
|
||||
# fmt: on
|
||||
try:
|
||||
out = run(cmd, capture_output=True, check=True).stdout
|
||||
out = run(cmd, capture_output=True, check=True, creationflags=CREATE_NO_WINDOW).stdout
|
||||
except CalledProcessError as e:
|
||||
raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user