Fix TypeError: Object of type int64 is not JSON serializable (#24340)
* Fix TypeError: Object of type int64 is not JSON serializable * Convert numpy.float64 and numpy.int64 to float and int for json serialization * Black reformatted examples/pytorch/token-classification/run_ner_no_trainer.py * * make style
This commit is contained in:
@@ -554,8 +554,8 @@ class Matcher(object):
|
||||
assert thresholds[0] > 0
|
||||
thresholds.insert(0, -float("inf"))
|
||||
thresholds.append(float("inf"))
|
||||
assert all([low <= high for (low, high) in zip(thresholds[:-1], thresholds[1:])])
|
||||
assert all([label_i in [-1, 0, 1] for label_i in labels])
|
||||
assert all(low <= high for (low, high) in zip(thresholds[:-1], thresholds[1:]))
|
||||
assert all(label_i in [-1, 0, 1] for label_i in labels)
|
||||
assert len(labels) == len(thresholds) - 1
|
||||
self.thresholds = thresholds
|
||||
self.labels = labels
|
||||
|
||||
Reference in New Issue
Block a user