mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
import required torch and numpy libraries (#25483)
This commit is contained in:
parent
fe3c8ab1af
commit
892f9ea0db
1 changed files with 4 additions and 0 deletions
|
|
@ -221,6 +221,10 @@ logits first, and then reshaped to match the size of the labels before you can c
|
|||
<pt>
|
||||
|
||||
```py
|
||||
>>> import numpy as np
|
||||
>>> import torch
|
||||
>>> from torch import nn
|
||||
|
||||
>>> def compute_metrics(eval_pred):
|
||||
... with torch.no_grad():
|
||||
... logits, labels = eval_pred
|
||||
|
|
|
|||
Loading…
Reference in a new issue