Modify the "Usage" section of the model card
Browse filesThe code snippet in the "Usage" section of the model card is not runnable per se because it requires a dataset and pre/post-processing. We now points toward the QA example of optimum-habana and give the command to run this example with ALBERT Large.
README.md
CHANGED
@@ -23,25 +23,26 @@ 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 ALBERT Large with the following command:
|
29 |
+
```bash
|
30 |
+
python run_qa.py \
|
31 |
+
--model_name_or_path albert-large-v2 \
|
32 |
+
--gaudi_config_name Habana/albert-large-v2 \
|
33 |
+
--dataset_name squad \
|
34 |
+
--do_train \
|
35 |
+
--do_eval \
|
36 |
+
--per_device_train_batch_size 32 \
|
37 |
+
--per_device_eval_batch_size 4 \
|
38 |
+
--learning_rate 5e-5 \
|
39 |
+
--num_train_epochs 2 \
|
40 |
+
--max_seq_length 384 \
|
41 |
+
--doc_stride 128 \
|
42 |
+
--output_dir /tmp/squad/ \
|
43 |
+
--use_habana \
|
44 |
+
--use_lazy_mode \
|
45 |
+
--throughput_warmup_steps 2
|
|
|
46 |
```
|
47 |
+
|
48 |
+
Check the [documentation](https://huggingface.co/docs/optimum/habana_index) out for more advanced usage and examples.
|