INNER CODE UNIT · Python
initialize_stt
existence-master/Sentient · src/server/main/app.py:87
def initialize_stt():
global stt_model_instance
logger.info(f"Initializing STT model provider: {STT_PROVIDER}")
if STT_PROVIDER == "FASTER_WHISPER":
try:
if FasterWhisperSTT: # Check if the import was successful
stt_model_instance = FasterWhisperSTT(
model_size=FASTER_WHISPER_MODEL_SIZE, device=FASTER_WHISPER_DEVICE,
compute_type=FASTER_WHISPER_COMPUTE_TYPE
)
else:
logger.error("FasterWhisperSTT is configured but could not be imported. Check dependencies.")
except Exception as e:
logger.error(f"Failed to initialize FasterWhisper STT: {e}", exc_info=True)
elif STT_PROVIDER == "ELEVENLABS":
if not ELEVENLABS_API_KEY:
logger.error("ELEVENLABS_API_KEY not set for STT.")
else: