mirror of
https://github.com/microsoft/FLAML.git
synced 2026-02-09 02:09:16 +08:00
isinstance(x, int) -> isinstance(x, (int, np.integer)) (#627)
* isinstance(x, int) -> isinstance(x, (int, np.integer))
This commit is contained in:
@@ -562,7 +562,7 @@ class LabelEncoderforTokenClassification:
|
||||
# if the labels are not tokens, they must be ids
|
||||
else:
|
||||
assert all(
|
||||
isinstance(id, int) for id in y[0]
|
||||
isinstance(id, (int, np.integer)) for id in y[0]
|
||||
), "The labels must either be tokens or ids"
|
||||
return y
|
||||
|
||||
|
||||
Reference in New Issue
Block a user