Skip to content

Commit 29f38b2

Browse files
authored
Merge pull request #781 from QData/black-issue
Update update_test_outputs.py
2 parents fce1f09 + df5f14d commit 29f38b2

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ more-itertools
2020
pinyin>=0.4.0
2121
jieba
2222
OpenHowNet
23-
click==8.0.2

tests/test_command_line/update_test_outputs.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
need to be manually edited to account for variance between runs.
55
"""
66

7-
87
from helpers import run_command_and_get_result
98
from test_attack import attack_test_params
109
from test_augment import augment_test_params
@@ -29,8 +28,6 @@ def update_test(command, outfile, add_magic_str=False):
2928
open(outfile, "w").write(stdout + "\n")
3029

3130

32-
33-
3431
def main():
3532
#### `textattack attack` tests ####
3633
for _, command, outfile in attack_test_params:
@@ -43,7 +40,5 @@ def main():
4340
update_test(command, outfile)
4441

4542

46-
47-
4843
if __name__ == "__main__":
4944
main()

textattack/transformations/word_swaps/chn_transformations/chinese_word_swap_masked.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-------------------------------------
44
"""
55

6-
from transformers import pipeline
6+
import torch
77

88
from . import WordSwap
99

@@ -13,8 +13,7 @@ class ChineseWordSwapMaskedLM(WordSwap):
1313
model."""
1414

1515
def __init__(self, task="fill-mask", model="xlm-roberta-base", **kwargs):
16-
from transformers import BertTokenizer, BertForMaskedLM
17-
import torch
16+
from transformers import BertForMaskedLM, BertTokenizer
1817

1918
self.tt = BertTokenizer.from_pretrained(model)
2019
self.mm = BertForMaskedLM.from_pretrained(model)

0 commit comments

Comments
 (0)