File size: 1,354 Bytes
6609c06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
"""
Simple launcher for SyncMaster with integrated server
ู…ูุดุบู„ ุจุณูŠุท ู…ุน ุฎุงุฏู… ู…ุชูƒุงู…ู„ - ู…ุซุงู„ูŠ ู„ู€ HuggingFace
"""

import streamlit as st
import os
import sys
import time

# Add current directory to path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

# Initialize integrated server first
recorder_server_started = False

def start_integrated_server():
    """Start the integrated recorder server"""
    global recorder_server_started
    
    if recorder_server_started:
        return True
    
    try:
        from integrated_server import ensure_recorder_server
        result = ensure_recorder_server()
        if result:
            recorder_server_started = True
            st.success("โœ… Integrated recorder server is running on port 5001")
        else:
            st.warning("โš ๏ธ Could not start integrated recorder server")
        return result
    except Exception as e:
        st.error(f"โŒ Error starting integrated recorder server: {e}")
        return False

# Start the integrated server when the module loads
start_integrated_server()

# Import the main app module
try:
    import app
except Exception as e:
    st.error(f"โŒ Error loading main application: {e}")
    st.stop()

if __name__ == "__main__":
    print("๐Ÿš€ SyncMaster main.py executed directly")