You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+1-29
Original file line number
Diff line number
Diff line change
@@ -246,35 +246,7 @@ Before you begin, make sure you have all the necessary libraries installed :
246
246
pip install optimum[onnxruntime-training]
247
247
```
248
248
249
-
```diff
250
-
- from transformers import Trainer, TrainingArguments
251
-
+ from optimum.onnxruntime import ORTTrainer, ORTTrainingArguments
252
-
253
-
# Download a pretrained model from the Hub
254
-
model = AutoModelForSequenceClassification.from_pretrained("bert-base-uncased")
255
-
256
-
# Define the training arguments
257
-
- training_args = TrainingArguments(
258
-
+ training_args = ORTTrainingArguments(
259
-
output_dir="path/to/save/folder/",
260
-
optim="adamw_ort_fused",
261
-
...
262
-
)
263
-
264
-
# Create a ONNX Runtime Trainer
265
-
- trainer = Trainer(
266
-
+ trainer = ORTTrainer(
267
-
model=model,
268
-
args=training_args,
269
-
train_dataset=train_dataset,
270
-
...
271
-
)
272
-
273
-
# Use ONNX Runtime for training!
274
-
trainer.train()
275
-
```
276
-
277
-
You can find more examples in the [documentation](https://huggingface.co/docs/optimum/onnxruntime/usage_guides/trainer) and in the [examples](https://github.com/huggingface/optimum/tree/main/examples/onnxruntime/training).
249
+
You can find examples in the [documentation](https://huggingface.co/docs/optimum/onnxruntime/usage_guides/trainer) and in the [examples](https://github.com/huggingface/optimum/tree/main/examples/onnxruntime/training).
0 commit comments