1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

update documentation and fix attack on empty worklist

This commit is contained in:
Jin Yong Yoo
2020-10-02 14:07:23 -04:00
parent d878843eb4
commit 8d038e1b6c
4 changed files with 7 additions and 3 deletions

View File

@@ -278,7 +278,9 @@ class Attack:
Returns:
results (Iterable[GoalFunctionResult]): an iterable of GoalFunctionResults of the original examples
"""
indices = indices or range(len(dataset))
if indices is None:
indices = range(len(dataset))
if not isinstance(indices, deque):
indices = deque(sorted(indices))