-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlight_chat.py
49 lines (38 loc) · 1.2 KB
/
light_chat.py
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
import sys
from multiprocessing import Process, freeze_support
from GUI.client import LightChatGPTClient
import GUI.api
import GUI.api.chatgpt_server_api
import GUI.api.google_translation_api
import GUI.plugins
import GUI.plugins.chatgpt
import GUI.plugins.google_translate
import GUI.plugins.file_transfer_server
import GUI.utils
import GUI.utils.global_hot_key
import GUI.utils.language
import GUI.utils.local_hot_key
import GUI.utils.position
import GUI.window
import GUI.window.floating_window
import GUI.window.main_window
import GUI.window.plugins_menu_window
import GUI.window.user_window
def run_GUI():
client = LightChatGPTClient()
client.run()
import flask
import HTTPServer.http_server_api
from HTTPServer.http_server_api import create_http_server
def run_HTTPServer(ip, port, share_data_path):
create_http_server(ip, port, share_data_path)
if __name__ == '__main__':
# prevent the packaged .exe program generate in a loop
freeze_support()
p1 = Process(target=run_GUI)
p1.start()
p2 = Process(target=run_HTTPServer, args=("0.0.0.0", 8000, "data/file_transfer_server_data.json"))
p2.start()
process_list = [p1, p2]
for p in process_list:
p.join()