-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoffline-setup.py
29 lines (19 loc) · 1.25 KB
/
offline-setup.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
with open('launch.py', 'r') as file :
filedata = file.read()
filedata = filedata.replace('run_pip(f\"install -r {requirements_file}\", \"requirements for Web UI\")', '#run_pip(f\"install -r {requirements_file}\", \"requirements for Web UI\")')
filedata = filedata.replace('run_pip(f\"install -r \\\"{requirements_file}\\\"\", \"requirements for Web UI\")', '#run_pip(f\"install -r \\\"{requirements_file}\\\"\", \"requirements for Web UI\")')
filedata = filedata.replace('launch_utils', 'launch_utils_offline')
with open('launch-offline.py', 'w') as file:
file.write(filedata)
################################################################
with open('modules\launch_utils.py', 'r') as file :
filedata = file.read()
filedata = filedata.replace('run_pip(f\"install -r \\\"{requirements_file}\\\"\", \"requirements\")', '#run_pip(f\"install -r \\\"{requirements_file}\\\"\", \"requirements\")')
with open('modules\launch_utils_offline.py', 'w') as file:
file.write(filedata)
################################################################
with open('webui.bat', 'r') as file :
filedata = file.read()
filedata = filedata.replace('launch.py', 'launch-offline.py')
with open('webui-offline.bat', 'w') as file:
file.write(filedata)