# ======================================= # ENTRY POINT - HUGGINGFACE SPACES # Vocal Articulation Assessment v2.0 # ======================================= import os import logging import gradio as gr # Suppress Starlette warnings logging.getLogger("starlette").setLevel(logging.ERROR) logging.getLogger("uvicorn").setLevel(logging.ERROR) from app.interface import create_interface, initialize_model from app.api_gradio import create_api_interface if __name__ == '__main__': print('Starting Vocal Articulation Assessment System v2.0...') # Initialize model once at startup (prevents double-run issue) print('Preloading Whisper model...') initialize_model() print('Model preloaded successfully!') # Create UI and API interfaces ui_demo = create_interface() api_demo = create_api_interface() # Combine both interfaces with tabs demo = gr.TabbedInterface( [ui_demo, api_demo], ["🎤 Assessment UI", "📡 JSON API"], title="Vocal Articulation System v2.0" ) # Launch demo.launch( server_name='0.0.0.0', server_port=7860, share=False, show_error=False, max_threads=40, quiet=True )