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

add back attack_n

This commit is contained in:
Jack Morris
2020-02-07 13:49:25 -05:00
parent a35073a6a5
commit a89f3b2079
3 changed files with 10 additions and 3 deletions

View File

@@ -76,8 +76,12 @@ def main():
while num_results < args.num_examples:
result = out_queue.get(block=True)
attack_logger.log_result(result)
pbar.update()
num_results += 1
if (not args.attack_n) or (not isinstance(result, textattack.attack_results.SkippedAttackResult)):
pbar.update()
num_results += 1
elif isinstance(result, textattack.attack_results.SkippedAttackResult):
label, text = next(dataset)
in_queue.put((label, text))
pbar.close()
print()
# Enable summary stdout.