Alert on python version added to mmt command
#!/usr/bin/env python3
-import argparse
import sys
-from cli import CLIArgsException
-from cli.mmt import MMT_JAR
+if not (sys.version_info.major == 3 and sys.version_info.minor > 5):
+ print("Wrong python version detected, required >= 3.6, but found %d.%d" %
+ (sys.version_info.major, sys.version_info.minor))
+ exit(1)
__description = '''\
ModernMT is a context-aware, incremental and distributed general purpose Neural Machine Translation technology
@@ -22,6 +23,8 @@ __description = '''\
def main():
+ import argparse
+ from cli import CLIArgsException
from cli import cleaning, datagen, train, create, server, translate, evaluate, memory
actions = {
@@ -71,5 +74,7 @@ def main():
if __name__ == '__main__':
+ from cli.mmt import MMT_JAR
+
sys.path.insert(0, MMT_JAR)
main()
