张磊

Results 10 issues of 张磊

from tqdm import tqdm for prompt in prompts: preds = [] labels = [] for data in tqdm(dataset): # process input input_text = pb.InputProcess.basic_format(prompt, data) label = data['label'] print(type(input_text)) raw_pred...

因为想要使用https://github.com/AdvAttack/BU-SPO这个攻击方法去进行一个大模型的攻击,可以将这个写进来吗?如果要自己写的话,是否有很好的模块添加的路线?

## bertattack original prompt: Evaluate the sentiment of the given text and classify it as 'positive' or 'negative': original score: 0.4934426229508197 attacked prompt: Evaluate the sеntiment of the given text...

Because the accuracy of my experimental results does not match the paper. Because I want to directly evaluate the prompt after being attacked by text to see if the score...

![微信图片_20240913235257](https://github.com/user-attachments/assets/0e2aff1c-ea7b-49aa-91b7-b7ab4ce516c4)

class GLUE(Dataset): """ GLUE class is a dataset class for the General Language Understanding Evaluation benchmark, supporting multiple natural language understanding tasks. Examples: [{'content': "it 's a charming and often...

I want to test other models according to your method, but I find it difficult to classify generative models. Please tell me how you solved it?

no-issue-activity

![Image](https://github.com/user-attachments/assets/fe007335-aafb-4f84-b812-b947c278fccd) ```python ```# create dataset dataset = pb.DatasetLoader.load_dataset("mmlu",local_path=localpathconfig.MMLU_PATH) #还有mrpc的实验 logging.info(f"数据集: mmlu") # 确保数据集包含足够的数据 if len(dataset) >= 1000: # 选择前1000条记录 validation_dataset = dataset[:1000] else: validation_dataset=dataset prompts = [ "In relation to...

no-issue-activity

If I don't change the @torch.no_grad() in the code, I can't run it and get an error that the loss forward propagation cannot be done. If I comment out @torch.no_grad(),...

def get_indices_to_order(self, current_text, **kwargs): """Applies ``pre_transformation_constraints`` to ``text`` to get all the indices that can be used to search and order. Args: current_text: The current ``AttackedText`` for which we need...