Change usage section
Browse files
README.md
CHANGED
@@ -23,25 +23,29 @@ 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 |
-
|
|
|
|
|
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_summarization.py) is a summarization example script to fine-tune a model. You can run it with T5-small with the following command:
|
29 |
+
```bash
|
30 |
+
python run_summarization.py \
|
31 |
+
--model_name_or_path t5-small \
|
32 |
+
--do_train \
|
33 |
+
--do_eval \
|
34 |
+
--dataset_name cnn_dailymail \
|
35 |
+
--dataset_config "3.0.0" \
|
36 |
+
--source_prefix "summarize: " \
|
37 |
+
--output_dir /tmp/tst-summarization \
|
38 |
+
--per_device_train_batch_size 4 \
|
39 |
+
--per_device_eval_batch_size 4 \
|
40 |
+
--overwrite_output_dir \
|
41 |
+
--predict_with_generate \
|
42 |
+
--use_habana \
|
43 |
+
--use_lazy_mode \
|
44 |
+
--gaudi_config_name Habana/t5 \
|
45 |
+
--ignore_pad_token_for_loss False \
|
46 |
+
--pad_to_max_length \
|
47 |
+
--save_strategy epoch \
|
48 |
+
--throughput_warmup_steps 2
|
49 |
```
|
50 |
+
|
51 |
+
Check the [documentation](https://huggingface.co/docs/optimum/habana/index) out for more advanced usage and examples.
|