| import sys |
| sys.path.append("modules/preprocess") |
|
|
| from preprocessor.SerialPreprocessor import SerialConfig, SerialPreprocessor |
| from const import ( |
| CHIT_CHAT |
| ) |
| from preprocessor.prompt_funcs import const_prompt_func_wrapper |
| from preprocessor.knowledge_funcs import ( |
| concat_list_knowledge_wrapper, |
| |
| ) |
| from preprocessor.label_funs import ( |
| extract_turn_utterance, |
| ) |
| import sys |
|
|
| if __name__ == "__main__": |
| TASK = CHIT_CHAT |
| input_data_path = sys.argv[1] |
| output_data_path = sys.argv[2] |
|
|
| serial_proc = SerialPreprocessor( |
| SerialConfig( |
| input_data_path, |
| output_data_path, |
| TASK, |
| logger_name=TASK, |
| task_bos_token=f"[{TASK}]", |
| prompt_func=const_prompt_func_wrapper( |
| "Response based on the dialogue context and given self persona" |
| ), |
| knowledge_func=concat_list_knowledge_wrapper("person 2 persona: ", " | "), |
| |
| label_func=extract_turn_utterance, |
| roles_to_build_example=[["person 2"]], |
| ) |
| ) |
|
|
| serial_proc.launch() |
|
|
| |