Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
fixing _strip for eventually int (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Aug 9, 2023
1 parent e76a61a commit b849ad2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/flash/core/data/utilities/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ def _as_list(x: Union[List, Tensor, np.ndarray]) -> List:
return x


def _strip(x: str) -> str:
return x.strip(", ")
def _strip(x: Union[str, int]) -> str:
"""Replace both ` ` and `,` from str."""
if isinstance(x, str):
return x.strip(", ")
return str(x)


@dataclass
Expand Down

0 comments on commit b849ad2

Please sign in to comment.