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:
@@ -60,7 +60,7 @@ class EndOfFunctionCriteria(StoppingCriteria):
|
||||
decoded_generations = self.tokenizer.batch_decode(input_ids[:, self.start_length :])
|
||||
done = []
|
||||
for decoded_generation in decoded_generations:
|
||||
done.append(any([stop_string in decoded_generation for stop_string in self.eof_strings]))
|
||||
done.append(any(stop_string in decoded_generation for stop_string in self.eof_strings))
|
||||
return all(done)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user