[ERROR] SentensePieceTokenizer 에러

김바덕·2023년 7월 12일
0

프로젝트

목록 보기
2/9
post-thumbnail

Fast Api 코드를 돌리는데 토크나이징 부분에서 지속적으로 같은 에러가 발생한다.

에러 내용은 다음과 같다.

예외가 발생했습니다. RuntimeError
When enable_sampling is True, We must specify "nbest_size > 1" or "nbest_size = -1", and "alpha". "nbest_size" is enabled only on unigram mode ignored in BPE-dropout. when "nbest_size = -1" , this method samples from all candidates on the lattice instead of nbest segmentations.
  File "C:\Users\user\Desktop\project\article_model\data_utils\vocab_tokenizer.py", line 183, in split
    tokens = self._split(string)
  File "C:\Users\user\Desktop\project\article_model\data_utils\vocab_tokenizer.py", line 223, in list_of_string_to_list_of_tokens
    X_token_batch.append(self.split(X_str))
  File "C:\Users\user\Desktop\project\article_model\data_utils\vocab_tokenizer.py", line 265, in list_of_string_to_list_of_cls_sep_token_ids
    X_token_batch = self.list_of_string_to_list_of_tokens(X_str_batch)
  File "C:\Users\user\Desktop\project\article_model\news_org.py", line 133, in get_org
    list_of_input_ids = self.tokenizer.list_of_string_to_list_of_cls_sep_token_ids([input_text])
  File "C:\Users\user\Desktop\project\sqlapp\put_to_db.py", line 78, in put_to_db
    title_result = org.get_org(org_article["title"][i].strip())
  File "C:\Users\user\Desktop\project\sqlapp\put_to_db.py", line 186, in <module>
    schedule.run_pending()
RuntimeError: When enable_sampling is True, We must specify "nbest_size > 1" or "nbest_size = -1", and "alpha". "nbest_size" is enabled only on unigram mode ignored in BPE-dropout. when "nbest_size = -1" , this method samples from all candidates on the lattice instead of nbest segmentations.

어제부터 하루종일 에러 해결 시도중인데, 아까는 alpha 값은 인자로 설정할 수없다고 하더니 이번엔 설정하라고 한다. ㅠㅠ 오늘 안으로 끝내고 싶다...

모델은 BERT, Ko-Bert 모델 fine-tuning하여 사용했다.

profile
UXUI Designer

0개의 댓글

관련 채용 정보