Skip to content

Commit bcd2be4

Browse files
committed
Update PyTorch .cpu().numpy() to .cpu().detach().numpy()
1 parent 21e81a7 commit bcd2be4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pythainlp/transliterate/thai2rom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def romanize(self, text: str) -> str:
9393
target_tensor = (
9494
torch.argmax(
9595
target_tensor_logits.squeeze(1),
96-
1).cpu().numpy()
96+
1).cpu().detach().numpy()
9797
)
9898
target = [self._ix_to_target_char[t] for t in target_tensor]
9999

pythainlp/transliterate/thaig2p.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def g2p(self, text: str) -> str:
9494
target_tensor = (
9595
torch.argmax(
9696
target_tensor_logits.squeeze(1),
97-
1).cpu().numpy()
97+
1).cpu().detach().numpy()
9898
)
9999
target = [self._ix_to_target_char[t] for t in target_tensor]
100100

0 commit comments

Comments
 (0)