1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

adding document on this parallel hotfix example script

This commit is contained in:
Yanjun Qi
2021-08-21 14:41:11 -04:00
parent 1d5f2ec758
commit f7a2218bdc
2 changed files with 8 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ The [documentation website](https://textattack.readthedocs.io/en/latest) contain
The easiest way to try out an attack is via the command-line interface, `textattack attack`.
> **Tip:** If your machine has multiple GPUs, you can distribute the attack across them using the `--parallel` option. For some attacks, this can really help performance.
> **Tip:** If your machine has multiple GPUs, you can distribute the attack across them using the `--parallel` option. For some attacks, this can really help performance. (If you want to attack Keras models in parallel, please check out `examples/attack/attack_keras_parallel.py` instead)
Here are some concrete examples:

View File

@@ -58,14 +58,12 @@ textattack train --model-name-or-path lstm --dataset yelp_polarity --epochs 50
```
*Fine-Tune `bert-base` on the `CoLA` dataset for 5 epochs**:
*Fine-Tune `bert-base` on the `CoLA` dataset for 5 epochs*:
```bash
textattack train --model-name-or-path bert-base-uncased --dataset glue^cola --per-device-train-batch-size 8 --epochs 5
```
### 2. Use Custom Models
TextAttack is model-agnostic! You can use `TextAttack` to analyze any model that outputs IDs, tensors, or strings. To help users, TextAttack includes pre-trained models for different common NLP tasks. This makes it easier for
@@ -138,3 +136,9 @@ This modular design unifies adversarial attack methods into one system, enables
### 6. The attacking is too slow
- **Tip:** If your machine has multiple GPUs, you can distribute the attack across them using the `--parallel` option. For some attacks, this can really help performance.
- If you want to attack Keras models in parallel, please check out `examples/attack/attack_keras_parallel.py` instead. (This is a hotfix for issues caused by a recent update of Keras in TF)