diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5ad72f2..9265289 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Cache pip uses: actions/cache@v2 @@ -39,10 +39,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Cache pip uses: actions/cache@v2 diff --git a/README.md b/README.md index 2119514..60f5d77 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Embedding(8002, 768, padding_idx=1) - `tokenization_kobert.py`를 랩핑한 파이썬 라이브러리 - KoBERT, DistilKoBERT를 Huggingface Transformers 라이브러리 형태로 제공 -- `v0.5.1`에서는 `transformers v3.0` 이상으로 기본 설치합니다. (`transformers v4.0` 까지는 이슈 없이 사용 가능) +- `v0.5.1`이상부터는 `transformers v3.0` 이상으로 기본 설치합니다. (`transformers v4.0` 까지는 이슈 없이 사용 가능) ### Install Kobert-Transformers diff --git a/kobert_transformers/load_model.py b/kobert_transformers/load_model.py index 30d6d35..463d191 100644 --- a/kobert_transformers/load_model.py +++ b/kobert_transformers/load_model.py @@ -2,24 +2,24 @@ def get_kobert_model(): - """ Return BertModel for Kobert """ + """Return BertModel for Kobert""" model = BertModel.from_pretrained("monologg/kobert") return model def get_kobert_lm(): - """ Return BertForMaskedLM for Kobert """ + """Return BertForMaskedLM for Kobert""" model = BertForMaskedLM.from_pretrained("monologg/kobert-lm") return model def get_distilkobert_model(): - """ Return DistilBertModel for DistilKobert """ + """Return DistilBertModel for DistilKobert""" model = DistilBertModel.from_pretrained("monologg/distilkobert") return model def get_distilkobert_lm(): - """ Return DistilBertForMaskedLM for DistilKobert """ + """Return DistilBertForMaskedLM for DistilKobert""" model = DistilBertForMaskedLM.from_pretrained("monologg/distilkobert") return model diff --git a/kobert_transformers/tokenization_kobert.py b/kobert_transformers/tokenization_kobert.py index 1efe2df..7442241 100644 --- a/kobert_transformers/tokenization_kobert.py +++ b/kobert_transformers/tokenization_kobert.py @@ -82,7 +82,6 @@ def __init__( mask_token="[MASK]", **kwargs, ): - # Build vocab self.token2idx = dict() self.idx2token = [] @@ -178,7 +177,7 @@ def _tokenize(self, text): return new_pieces def _convert_token_to_id(self, token): - """ Converts a token (str/unicode) in an id using the vocab. """ + """Converts a token (str/unicode) in an id using the vocab.""" return self.token2idx.get(token, self.token2idx[self.unk_token]) def _convert_id_to_token(self, index): diff --git a/kobert_transformers/version.txt b/kobert_transformers/version.txt index 5d4294b..09a3acf 100644 --- a/kobert_transformers/version.txt +++ b/kobert_transformers/version.txt @@ -1 +1 @@ -0.5.1 \ No newline at end of file +0.6.0 \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 9f207f2..5f74681 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # for clean code :) -isort==5.7.0 -black==20.8b1 -flake8==3.8.4 +isort==5.12.0 +black==23.10.0 +flake8==6.1.0 # for safe code :) -pytest==6.2.1 \ No newline at end of file +pytest==7.4.2 \ No newline at end of file