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:
@@ -50,7 +50,7 @@ def _get_single_answer(example):
|
||||
answer["remove_it"] = False
|
||||
|
||||
cols = ["start_token", "end_token", "start_byte", "end_byte", "text"]
|
||||
if not all([isinstance(answer[k], list) for k in cols]):
|
||||
if not all(isinstance(answer[k], list) for k in cols):
|
||||
raise ValueError("Issue in ID", example["id"])
|
||||
|
||||
return answer
|
||||
|
||||
Reference in New Issue
Block a user