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:
@@ -334,7 +334,7 @@ class RwkvModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin
|
||||
if param.requires_grad:
|
||||
# check if it's a ones like
|
||||
self.assertTrue(torch.allclose(param.data, torch.ones_like(param.data), atol=1e-5, rtol=1e-5))
|
||||
elif any([x in name for x in ["time_mix_key", "time_mix_receptance"]]):
|
||||
elif any(x in name for x in ["time_mix_key", "time_mix_receptance"]):
|
||||
if param.requires_grad:
|
||||
self.assertInterval(
|
||||
param.data,
|
||||
|
||||
Reference in New Issue
Block a user