-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpreload.py
38 lines (33 loc) · 1.06 KB
/
preload.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
from pathlib import Path
from inspect import getsourcefile
from os.path import abspath
def preload(parser):
parser.add_argument(
"--distributed-remotes",
nargs="+",
help="Enter n pairs of sockets",
type=lambda t: t.split(":")
)
parser.add_argument(
"--distributed-skip-verify-remotes",
help="Disable verification of remote worker TLS certificates",
action="store_true"
)
parser.add_argument(
"--distributed-remotes-autosave",
help="Enable auto-saving of remote worker generations",
action="store_true"
)
parser.add_argument(
"--distributed-debug",
help="Enable debug information",
action="store_true"
)
extension_path = Path(abspath(getsourcefile(lambda: 0))).parent
config_path = extension_path.joinpath('distributed-config.json')
# add config file
parser.add_argument(
"--distributed-config",
help="config file to load / save, default: $WEBUI_PATH/distributed-config.json",
default=config_path
)