QA doc: import torch before it is used (#24228)

* import torch before it is used

* style

Signed-off-by: byhsu <byhsu@linkedin.com>

---------

Signed-off-by: byhsu <byhsu@linkedin.com>
Co-authored-by: byhsu <byhsu@linkedin.com>
This commit is contained in:
ByronHsu
2023-06-14 03:23:55 -07:00
committed by GitHub
parent 6ab045d6fe
commit 91b62f5a78

View File

@@ -369,6 +369,7 @@ Tokenize the text and return PyTorch tensors:
Pass your inputs to the model and return the `logits`: Pass your inputs to the model and return the `logits`:
```py ```py
>>> import torch
>>> from transformers import AutoModelForQuestionAnswering >>> from transformers import AutoModelForQuestionAnswering
>>> model = AutoModelForQuestionAnswering.from_pretrained("my_awesome_qa_model") >>> model = AutoModelForQuestionAnswering.from_pretrained("my_awesome_qa_model")