huggingface / notebooks

Notebooks using the Hugging Face libraries 🤗
Apache License 2.0
3.61k stars 1.51k forks source link

Summarization: model.to(device)? #40

Open ibarrien opened 3 years ago

ibarrien commented 3 years ago

In the summarization notebook, where/when do we set the device? Are parallel gpus expected? Two things that could help: i) specify where we could set the device and call model.to(device) and ii) explicate where the model might expect data in parallel e.g. how setting batched=True in the pre-processing or how DataCollatorForSeq2Seq expects tensors.

NielsRogge commented 2 years ago

Hi,

The Trainer automatically handles device placement for you. Read more in the documentation: https://huggingface.co/docs/transformers/main_classes/trainer#trainer