Skip to content

Commit

Permalink
fix format issue in chinse_word_swap_masked.py
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyanjun committed Mar 11, 2024
1 parent e8f74bc commit df5f14d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ more-itertools
pinyin>=0.4.0
jieba
OpenHowNet
click==8.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-------------------------------------
"""

from transformers import pipeline
import torch

from . import WordSwap

Expand All @@ -13,8 +13,7 @@ class ChineseWordSwapMaskedLM(WordSwap):
model."""

def __init__(self, task="fill-mask", model="xlm-roberta-base", **kwargs):
from transformers import BertTokenizer, BertForMaskedLM
import torch
from transformers import BertForMaskedLM, BertTokenizer

self.tt = BertTokenizer.from_pretrained(model)
self.mm = BertForMaskedLM.from_pretrained(model)
Expand Down

0 comments on commit df5f14d

Please sign in to comment.