Moving token-classification pipeline to new testing. (#13286)

* Moving `token-classification` pipeline to new testing.

* Fix tests.
This commit is contained in:
Nicolas Patry
2021-08-27 11:24:56 +02:00
committed by GitHub
parent a6e36558ef
commit 45a8eb66bb
3 changed files with 185 additions and 113 deletions

View File

@@ -1329,7 +1329,7 @@ def nested_simplify(obj, decimals=3):
return nested_simplify(obj.numpy().tolist())
elif isinstance(obj, float):
return round(obj, decimals)
elif isinstance(obj, np.float32):
elif isinstance(obj, (np.int32, np.float32)):
return nested_simplify(obj.item(), decimals)
else:
raise Exception(f"Not supported: {type(obj)}")