QData / TextAttack

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/
https://textattack.readthedocs.io/en/master/
MIT License
2.98k stars 397 forks source link

中文对抗样本为什么报错 #762

Closed liuyuyan2717 closed 11 months ago

liuyuyan2717 commented 1 year ago

Describe the bug 运行中文对抗样本实例,报错 AttributeError Traceback (most recent call last) in <cell line: 17>() 15 from textattack.goal_functions import UntargetedClassification 16 ---> 17 from textattack import Attack, Attacker, AttackArgs 18 from textattack.loggers import CSVLogger 19 from textattack.datasets import Dataset, HuggingFaceDataset

3 frames /content/drive/MyDrive/pytorch_file/TextAttack/TextAttack/textattack/commands/eval_model_command.py in 18 from textattack.model_args import HUGGINGFACE_MODELS, TEXTATTACK_MODELS 19 ---> 20 logger = textattack.shared.utils.logger 21 22

AttributeError: partially initialized module 'textattack' has no attribute 'shared' (most likely due to a circular import)