med-bot / app.py
titanhacker's picture
Create app.py
fa0aa74 verified
raw
history blame
1.06 kB
import subprocess
import time
def run_process(command):
"""
Function to run a command in a separate terminal window.
This is platform-dependent; works for Windows (cmd) in this example.
"""
return subprocess.Popen(['start', 'cmd', '/k', command], shell=True)
if __name__ == "__main__":
# Step 1: Run the data upload script
print("Running upload_data_manually.py...")
subprocess.call('python src\\upload_data_manually.py', shell=True)
# Give some time for the upload script to complete
time.sleep(5)
# Step 2: Run the reference server
print("Starting reference_serve.py in a new terminal...")
run_process('python src\\reference_serve.py')
# Step 3: Run the LLM service
time.sleep(2)
print("Starting llm_service.py in a new terminal...")
run_process('python src\\llm_service.py')
# Step 4: Run the app
time.sleep(2)
print("Starting app.py in a new terminal...")
run_process('python src\\app.py')
print("All services are running. Check the separate terminal windows.")