MCPcopy Index your code
hub / github.com/OpenMotionLab/MotionGPT / parse_args

Function parse_args

mGPT/config.py:64–217  ·  view source on GitHub ↗

Parse arguments and load config files

(phase="train")

Source from the content-addressed store, hash-verified

62 return cfg
63
64def parse_args(phase="train"):
65 """
66 Parse arguments and load config files
67 """
68
69 parser = ArgumentParser()
70 group = parser.add_argument_group("Training options")
71
72 # Assets
73 group.add_argument(
74 "--cfg_assets",
75 type=str,
76 required=False,
77 default="./configs/assets.yaml",
78 help="config file for asset paths",
79 )
80
81 # Default config
82 if phase in ["train", "test"]:
83 cfg_defualt = "./configs/default.yaml"
84 elif phase == "render":
85 cfg_defualt = "./configs/render.yaml"
86 elif phase == "webui":
87 cfg_defualt = "./configs/webui.yaml"
88
89 group.add_argument(
90 "--cfg",
91 type=str,
92 required=False,
93 default=cfg_defualt,
94 help="config file",
95 )
96
97 # Parse for each phase
98 if phase in ["train", "test"]:
99 group.add_argument("--batch_size",
100 type=int,
101 required=False,
102 help="training batch size")
103 group.add_argument("--num_nodes",
104 type=int,
105 required=False,
106 help="number of nodes")
107 group.add_argument("--device",
108 type=int,
109 nargs="+",
110 required=False,
111 help="training device")
112 group.add_argument("--task",
113 type=str,
114 required=False,
115 help="evaluation task type")
116 group.add_argument("--nodebug",
117 action="store_true",
118 required=False,
119 help="debug or not")
120
121

Callers 6

mainFunction · 0.90
mainFunction · 0.90
render_cliFunction · 0.90
app.pyFile · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls 2

get_module_configFunction · 0.85
resume_configFunction · 0.85

Tested by 1

mainFunction · 0.72