Spaces:
Runtime error
Runtime error
d-matrix
commited on
Update dmx_perplexity.py
Browse filessetting device for loss to avoid device mismatch when stacking
- dmx_perplexity.py +1 -1
dmx_perplexity.py
CHANGED
|
@@ -118,7 +118,7 @@ class DmxPerplexity(evaluate.Metric):
|
|
| 118 |
else:
|
| 119 |
neg_log_likelihood = outputs.loss * trg_len
|
| 120 |
|
| 121 |
-
nlls.append(neg_log_likelihood)
|
| 122 |
|
| 123 |
prev_end_loc = end_loc
|
| 124 |
if end_loc == seq_len:
|
|
|
|
| 118 |
else:
|
| 119 |
neg_log_likelihood = outputs.loss * trg_len
|
| 120 |
|
| 121 |
+
nlls.append(neg_log_likelihood.to(device))
|
| 122 |
|
| 123 |
prev_end_loc = end_loc
|
| 124 |
if end_loc == seq_len:
|