We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4915a77 commit 6aaac9cCopy full SHA for 6aaac9c
pythainlp/transliterate/thaig2p_v2.py
@@ -16,7 +16,7 @@ class ThaiG2P:
16
Latin transliteration of Thai words, using International Phonetic Alphabet
17
"""
18
19
- def __init__(self, device: str="cpu"):
+ def __init__(self, device: str = "cpu"):
20
self.pipe = pipeline("text2text-generation", model="pythainlp/thaig2p-v2.0", device=device)
21
22
def g2p(self, text: str) -> str:
@@ -28,6 +28,6 @@ def g2p(self, text: str) -> str:
28
29
def transliterate(text: str, device="cpu") -> str:
30
global _THAI_G2P
31
- if _THAI_G2P == None:
+ if _THAI_G2P is None:
32
_THAI_G2P = ThaiG2P(device=device)
33
return _THAI_G2P.g2p(text)
0 commit comments