Change usage section
Browse files
README.md
CHANGED
@@ -23,25 +23,25 @@ This enables to specify:
|
|
23 |
## Usage
|
24 |
|
25 |
The model is instantiated the same way as in the Transformers library.
|
26 |
-
The only difference is that there are a few new training arguments specific to HPUs
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
)
|
46 |
-
trainer.train()
|
47 |
```
|
|
|
|
|
|
23 |
## Usage
|
24 |
|
25 |
The model is instantiated the same way as in the Transformers library.
|
26 |
+
The only difference is that there are a few new training arguments specific to HPUs.
|
27 |
+
|
28 |
+
[Here](https://github.com/huggingface/optimum-habana/blob/main/examples/question-answering/run_qa.py) is a question-answering example script to fine-tune a model on SQuAD. You can run it with BERT with the following command:
|
29 |
+
```bash
|
30 |
+
python run_qa.py \
|
31 |
+
--model_name_or_path bert-base-uncased \
|
32 |
+
--gaudi_config_name Habana/bert-base-uncased \
|
33 |
+
--dataset_name squad \
|
34 |
+
--do_train \
|
35 |
+
--do_eval \
|
36 |
+
--per_device_train_batch_size 24 \
|
37 |
+
--per_device_eval_batch_size 8 \
|
38 |
+
--learning_rate 3e-5 \
|
39 |
+
--num_train_epochs 2 \
|
40 |
+
--max_seq_length 384 \
|
41 |
+
--output_dir /tmp/squad/ \
|
42 |
+
--use_habana \
|
43 |
+
--use_lazy_mode \
|
44 |
+
--throughput_warmup_steps 2
|
|
|
|
|
45 |
```
|
46 |
+
|
47 |
+
Check the [documentation](https://huggingface.co/docs/optimum/habana/index) out for more advanced usage and examples.
|