Skip to content

Commit

Permalink
Merge pull request #781 from QData/black-issue
Browse files Browse the repository at this point in the history
Update update_test_outputs.py
  • Loading branch information
qiyanjun authored Mar 11, 2024
2 parents fce1f09 + df5f14d commit 29f38b2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ more-itertools
pinyin>=0.4.0
jieba
OpenHowNet
click==8.0.2
5 changes: 0 additions & 5 deletions tests/test_command_line/update_test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
need to be manually edited to account for variance between runs.
"""


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




def main():
#### `textattack attack` tests ####
for _, command, outfile in attack_test_params:
Expand All @@ -43,7 +40,5 @@ def main():
update_test(command, outfile)




if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-------------------------------------
"""

from transformers import pipeline
import torch

from . import WordSwap

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

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

self.tt = BertTokenizer.from_pretrained(model)
self.mm = BertForMaskedLM.from_pretrained(model)
Expand Down

0 comments on commit 29f38b2

Please sign in to comment.