deque with truncation fix
@@ -358,7 +358,8 @@ class PaddingUtils(object):
else:
parsed_x = [dictionary.txt2vec(ex['text']) for ex in exs]
- if dq and not isinstance(parsed_x[0], deque):
+ if dq:
+ if not isinstance(parsed_x[0], deque):
parsed_x = [deque(x, maxlen=truncate) for x in parsed_x]
elif truncate is not None and truncate > 0:
parsed_x = [x[-truncate:] for x in parsed_x]
