added MultiProcessEval to mimic multiprocessing_train.py
@@ -29,6 +29,7 @@ import os
import signal
import parlai.utils.distributed as distributed_utils
import parlai.scripts.eval_model as eval_model
+from parlai.core.script import ParlaiScript, register_script
def multiprocess_eval(
@@ -78,11 +79,16 @@ def setup_args():
return parser
-def main():
- opt = setup_args().parse_args()
+@register_script("multiprocessing_eval", aliases=["mp_eval"], hidden=True)
+class MultiProcessEval(ParlaiScript):
+ @classmethod
+ def setup_args(cls):
+ return setup_args()
+
+ def run(self):
port = random.randint(32000, 48000)
- return launch_and_eval(opt, port)
+ return launch_and_eval(self.opt, port)
if __name__ == '__main__':
- main()
+ MultiProcessEval.main()
