Skip to content

Commit e7ef6ce

Browse files
authored
Update phayathaibert.py
Use UPPERCASE for constant
1 parent 9999f90 commit e7ef6ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pythainlp/augment/lm/phayathaibert.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
from pythainlp.phayathaibert.core import ThaiTextProcessor
1010

1111

12-
_model_name = "clicknext/phayathaibert"
12+
_MODEL_NAME = "clicknext/phayathaibert"
1313

1414

1515
class ThaiTextAugmenter:
1616
def __init__(self,) -> None:
1717
from transformers import (AutoTokenizer,
1818
AutoModelForMaskedLM,
1919
pipeline,)
20-
self.tokenizer = AutoTokenizer.from_pretrained(_model_name)
21-
self.model_for_masked_lm = AutoModelForMaskedLM.from_pretrained(_model_name)
20+
self.tokenizer = AutoTokenizer.from_pretrained(_MODEL_NAME)
21+
self.model_for_masked_lm = AutoModelForMaskedLM.from_pretrained(_MODEL_NAME)
2222
self.model = pipeline("fill-mask", tokenizer=self.tokenizer, model=self.model_for_masked_lm)
2323
self.processor = ThaiTextProcessor()
2424

@@ -88,7 +88,7 @@ def augment(self,
8888
augment_list.append(processed_text)
8989

9090
return augment_list
91-
91+
9292
raise ValueError(
9393
f"augmentation of more than {num_augs} is exceeded the default limit: {MAX_NUM_AUGS}"
9494
)

0 commit comments

Comments
 (0)