Slightly better display_model output.
@@ -10,6 +10,21 @@ import os
import random
import time
+DISPLAY_MESSAGE_DEFAULT_IGNORE = {
+ 'episode_done',
+ 'id',
+ 'image',
+ 'text',
+ 'labels',
+ 'eval_labels',
+ 'label_candidates',
+ 'text_candidates',
+ 'reward',
+ 'eval_labels_vec',
+ 'text_vec',
+ 'label_candidates_vecs'
+}
+
def maintain_dialog_history(history, observation, reply='',
historyLength=1, useReplies='label_else_model',
@@ -664,7 +679,7 @@ def display_messages(msgs, prettify=False, ignore_fields='', max_len=1000):
if msg.get('reward', 0) != 0:
lines.append(space + '[reward: {r}]'.format(r=msg['reward']))
for key in msg:
- if key not in ['episode_done', 'id', 'image', 'text', 'labels', 'eval_labels', 'label_candidates', 'text_candidates', 'reward'] and key not in ignore_fields:
+ if key not in DISPLAY_MESSAGE_DEFAULT_IGNORE and key not in ignore_fields:
line = '[' + key + ']: ' + clip_text(str(msg.get(key)), max_len)
lines.append(space + line)
if type(msg.get('image')) == str:
