File size: 1,065 Bytes
025f5af
 
 
 
 
370e1b6
025f5af
 
 
370e1b6
025f5af
 
5b3e7a3
025f5af
 
370e1b6
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import subprocess
import time

def start_controller():
    subprocess.Popen(['python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000'])
    time.sleep(10)  # wait for the controller to start

def start_gradio_web_server():
    subprocess.Popen(['python', '-m', 'llava.serve.gradio_web_server', '--controller', 'http://localhost:10000', '--model-list-mode', 'reload'])
    time.sleep(10)  # wait for the web server to start

def start_model_worker():
    subprocess.Popen(['python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--port', '40000', '--worker', 'http://localhost:40000', '--model-path', 'liuhaotian/llava-v1.5-13b'])

if __name__ == "__main__":
    start_controller()  # Starts the controller process
    start_gradio_web_server()  # Starts the Gradio web server process
    start_model_worker()  # Starts the model worker process

    # Keep the script running to maintain the subprocesses alive
    while True:
        time.sleep(3600)  # Sleep for 1 hour, adjust as needed