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:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user