reddy-lab-code-research / CodeAttack

Code for the AAAI 2023 paper "CodeAttack: Code-based Adversarial Attacks for Pre-Trained Programming Language Models
22 stars 6 forks source link

Unresolved dependency in codeattack.py, "from textfooler.utils_textfooler import get_var, get_sim_predictor" #2

Open JamesCao2048 opened 1 year ago

JamesCao2048 commented 1 year ago

Thank you for your interesting work and open source code! I am trying to replicate the package, but it seems that the dependency "from textfooler.utils_textfooler import get_var, get_sim_predictor" in codeattack.py doest not exist in requirement.yml, how to install it? By the way, I tried to look for textfooler.utils_textfooler in https://github.com/jind11/TextFooler, but did not find anything related.

Looking forward to your reply, Sincerely

JamesCao2048 commented 1 year ago

The same issue for

from textfooler.get_substitutes_textfooler import get_substitutes_textfooler
from textfooler.get_substitutes_textfooler import get_similarity_score 

in attack.py

eghannoum commented 1 year ago

Thank you for your interesting work and open source code! I am trying to replicate the package, but it seems that the dependency "from textfooler.utils_textfooler import get_var, get_sim_predictor" in codeattack.py doest not exist in requirement.yml, how to install it? By the way, I tried to look for textfooler.utils_textfooler in https://github.com/jind11/TextFooler, but did not find anything related.

Looking forward to your reply, Sincerely

Did you mange to find a solution for the problem because I have the same issue?

JamesCao2048 commented 1 year ago

Unfortunately not, I temporatily comment out these lines and only run CodeAttack algorithm they provided. Btw, I found that CodeAttack does not gurantee the generated code mutants are syntactically correct.

YuJieF commented 1 year ago

Thank you for your interesting work and open source code! I am trying to replicate the package, but it seems that the dependency "from textfooler.utils_textfooler import get_var, get_sim_predictor" in codeattack.py doest not exist in requirement.yml, how to install it? By the way, I tried to look for textfooler.utils_textfooler in https://github.com/jind11/TextFooler, but did not find anything related. Looking forward to your reply, Sincerely

Did you mange to find a solution for the problem because I have the same issue?

I meet the same question. Did you find a solution now?

HuichiZhou commented 6 months ago

Unfortunately not, I temporatily comment out these lines and only run CodeAttack algorithm they provided. Btw, I found that CodeAttack does not gurantee the generated code mutants are syntactically correct. How can I find the fine-tuned pretrain model? I found this project lacks of many necessary file.