mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-01 21:20:33 +00:00
Alpine fix version, STT fixes
This commit is contained in:
parent
81e653ba2d
commit
c99b1a47d4
5 changed files with 52 additions and 64 deletions
|
|
@ -3,16 +3,20 @@ import base64
|
|||
import warnings
|
||||
import whisper
|
||||
import tempfile
|
||||
from python.helpers import runtime, rfc
|
||||
from python.helpers import runtime, rfc, settings
|
||||
|
||||
# suppress FutureWarning from torch.load
|
||||
warnings.filterwarnings('ignore', category=FutureWarning)
|
||||
|
||||
model = None
|
||||
model_name = ""
|
||||
|
||||
def preload():
|
||||
global model
|
||||
model = whisper.load_model("base")
|
||||
global model, model_name
|
||||
set = settings.get_settings()
|
||||
if not model or model_name != set["stt_model_size"]:
|
||||
model = whisper.load_model(set["stt_model_size"])
|
||||
model_name = set["stt_model_size"]
|
||||
return model
|
||||
|
||||
async def transcribe(audio_bytes_b64: str):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue