File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ def both(config: Config) -> None:
9595 logger .info ("Eval step finished." )
9696
9797
98+ def activate_data_module (config : Config , config_path : str ):
99+ """Check whether to activate data module and preprocess datasets."""
100+ data_config = config .data
101+ if data_config .dj_config_path or data_config .dj_process_desc :
102+ from trinity .data .client import request , LOCAL_SERVER_URL
103+ logger .info ("Activating data module..." )
104+ res = request (
105+ url = LOCAL_SERVER_URL ,
106+ configPath = config_path ,
107+ )
108+ if res ["return_code" ] != 0 :
109+ logger .error (f"Failed to activate data module: { res ['return_msg' ]} ." )
110+ return
111+
112+
98113def main () -> None :
99114 """The main entrypoint."""
100115 parser = argparse .ArgumentParser ()
@@ -111,6 +126,8 @@ def main() -> None:
111126 # TODO: support parse all args from command line
112127 config = load_config (args .config )
113128 config .check_and_update ()
129+ # try to activate data module
130+ activate_data_module (config , args .config )
114131 ray .init ()
115132 if config .mode == "explore" :
116133 explore (config )
You can’t perform that action at this time.
0 commit comments