Skip to content

Commit

Permalink
Fixed pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Aug 13, 2024
1 parent 4915a77 commit 6aaac9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pythainlp/transliterate/thaig2p_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ThaiG2P:
Latin transliteration of Thai words, using International Phonetic Alphabet
"""

def __init__(self, device: str="cpu"):
def __init__(self, device: str = "cpu"):
self.pipe = pipeline("text2text-generation", model="pythainlp/thaig2p-v2.0", device=device)

def g2p(self, text: str) -> str:
Expand All @@ -28,6 +28,6 @@ def g2p(self, text: str) -> str:

def transliterate(text: str, device="cpu") -> str:
global _THAI_G2P
if _THAI_G2P == None:
if _THAI_G2P is None:
_THAI_G2P = ThaiG2P(device=device)
return _THAI_G2P.g2p(text)

0 comments on commit 6aaac9c

Please sign in to comment.