[docs] add xpu device check (#34684)
* add XPU path * use accelerate API * Update docs/source/en/tasks/semantic_segmentation.md Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> * update more places with accelerate API --------- Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
This commit is contained in:
@@ -1488,7 +1488,9 @@ Now that you have finetuned a model, evaluated it, and uploaded it to the Huggin
|
||||
|
||||
Load model and image processor from the Hugging Face Hub (skip to use already trained in this session):
|
||||
```py
|
||||
>>> device = "cuda"
|
||||
>>> from accelerate.test_utils.testing import get_backend
|
||||
# automatically detects the underlying device type (CUDA, CPU, XPU, MPS, etc.)
|
||||
>>> device, _, _ = get_backend()
|
||||
>>> model_repo = "qubvel-hf/detr_finetuned_cppe5"
|
||||
|
||||
>>> image_processor = AutoImageProcessor.from_pretrained(model_repo)
|
||||
|
||||
Reference in New Issue
Block a user