Change usage section
Browse files
README.md
CHANGED
@@ -23,25 +23,23 @@ 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 |
-
args=args,
|
44 |
-
tokenizer=tokenizer,
|
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/language-modeling/run_clm.py) is a causal language modeling example script to pre-train/fine-tune a model. You can run it with GPT2 with the following command:
|
29 |
+
```bash
|
30 |
+
python run_clm.py \
|
31 |
+
--model_name_or_path gpt2 \
|
32 |
+
--dataset_name wikitext \
|
33 |
+
--dataset_config_name wikitext-2-raw-v1 \
|
34 |
+
--per_device_train_batch_size 4 \
|
35 |
+
--per_device_eval_batch_size 4 \
|
36 |
+
--do_train \
|
37 |
+
--do_eval \
|
38 |
+
--output_dir /tmp/test-clm \
|
39 |
+
--gaudi_config_name Habana/gpt2 \
|
40 |
+
--use_habana \
|
41 |
+
--use_lazy_mode \
|
42 |
+
--throughput_warmup_steps 2
|
|
|
|
|
|
|
|
|
43 |
```
|
44 |
+
|
45 |
+
Check the [documentation](https://huggingface.co/docs/optimum/habana/index) out for more advanced usage and examples.
|