-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bertattack #88
Comments
There are no problems with attacks on other data sets, but there are problems with bertattack on rte and wnli data sets. |
Hi, could you share the relevant problematic code snippets with me? |
The difficult thing is that I don’t know in which code fragment it occurs. It occurs in the wnli and rte data sets, but in other data sets this situation of running but not producing results does not occur. |
try: create datasetdataset = pb.DatasetLoader.load_dataset("rte",local_path=localpathconfig.GLUE_PATH) #还有mrpc的实验 确保数据集包含足够的数据if len(dataset) >= 1000: prompts = [ question ="\nQuestion: {content}\nAnswer:" define the projection function required by the output processdef proj_func(pred): define the evaluation function required by the attackdef eval_func(prompt, validation_dataset, model):
unmodifiable_words = [ "entailment'", "not_entailment'","content"] print all supported attacksprint(Attack.attack_list()) def writetofile(key): writetofile("bertattack") 依次使用每条提示进行攻击for prompt in prompts: |
I think you could first create a minimal reproducible example by removing any non-essential code. Once you have the simplest version that still shows the problem, we can work together to solve this issue. |
After I performed a bertattack on the previous data set, the bertattack on the next data set appeared. It has been running, but no progress and scores appeared. I was thinking that it should be a certain universal-sentence-encoder. There is a problem with the loading of the model, but no error is reported there, it just keeps running without results.
The text was updated successfully, but these errors were encountered: