summaryrefslogtreecommitdiff
path: root/training/mira/mira.py
diff options
context:
space:
mode:
Diffstat (limited to 'training/mira/mira.py')
-rwxr-xr-xtraining/mira/mira.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/training/mira/mira.py b/training/mira/mira.py
index 89822d41..f031c313 100755
--- a/training/mira/mira.py
+++ b/training/mira/mira.py
@@ -271,8 +271,10 @@ def write_report(graph_file, dev_results, dev_bleu,
out.close()
if args.email:
- email_process = subprocess.Popen(['mail', '-s', subject, '-a',
- graph_file, args.email], stdin = subprocess.PIPE)
+ cmd = ['mail', '-s', subject]
+ if graph_file:
+ cmd += ['-a', graph_file]
+ email_process = subprocess.Popen(cmd+[args.email], stdin = subprocess.PIPE)
email_process.communicate(message)
#feature weights stats for report