ai-server / app.py
nuernie
adjust
75a1c55
raw
history blame
800 Bytes
import os
import logging
from whisper_live.server import TranscriptionServer
# Set up HuggingFace cache directory
os.environ['TRANSFORMERS_CACHE'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), '.cache/huggingface')
# β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
# Logging
# β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == "__main__":
# Create and start the transcription server
transcription_server = TranscriptionServer()
transcription_server.run(
host='0.0.0.0',
port=7860, # Using the default WebSocket port from the whisper_live library
backend='faster_whisper'
)