Before using our code, we recommend running FedeVocab according to the following directory structure:
├── workspace
│ └── data
| | └── fednlp_data
│ ├── pretrain
│ │ └── cv
│ ├── output
│ └── code
│ └── fedevocab
You can run the following command:
mkdir workspace
cd workspace
mkdir data
mkdir code
mkdir pretrained
cd pretrained
mkdir nlp
cd ..
cd code
The python
version of the running environment is 3.7+
and the pytorch
version is 1.10+
.
git clone
cd fedevocab
pip install -r resquirements.txt
Our code is built on FedNLP. To use our code, you must clone FedNLP.
bash run/detlm_alone/fedrun_sweep.sh sst_2 distilbert v100 2
bash run/attack/dlg.sh /workspace {save_times} {model_type} {gpu_id} {batch_size}