xiangyue9607 / DP-Forward

20 stars 2 forks source link

Couldn't find "sst2_eps8_embedding" on hugging face in embedding inversion attack. #2

Closed NDBTjay closed 6 months ago

NDBTjay commented 9 months ago

In the file attacks/embedding_inversion_attack.py it uses the following code to load pretrained model on hugging face, but it can't find "sst2_eps8_embedding"

model = BertForSequenceClassification.from_pretrained("bert-base-uncased")
model_dp = BertForSequenceClassification.from_pretrained("sst2_eps8_embedding")
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")

It tells me

OSError: sst2_eps8_embedding is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`

What's more, the example of "embedding_inversion_attack.py" in readme.md is mistaken to be replaced with "sensitive_attributes_attack.py". Could you please give a correct example for embedding inversion attack?

9Zzhang commented 7 months ago

May I ask if you later found a solution to your problem later on?

xiangyue9607 commented 6 months ago

You could train this model sst2_eps8_embedding using dp-forward training script on sst2 with eps=8 on your own side.