Sign In

개발삽질기

[Error] ModernBERT기반 모델 사용할 때 발생하는 오류
ModernBERT 사용 시 발생하는 오류 MTEB으로 ColBERT 모델 평가를 하다가 아래와 같은 에러가 발생했다.. TypeError: ModernBertModel.forward() got an unexpected keyword argument 'token_type_ids' 해당 에러는 ModernBERT에서 발생하는 에러인데, ModernBERT 구조상 token_type_ids 를 리턴하지 않기 때문에 발생하는 에러이다. Huggingface에서 ModernBERT를 소개하는 글에서 다음과 같이 말한다. Note: ModernBERT does not use token type IDs, unlike some earlier BERT models. Most downstream usage is identical to standard BERT models on the Hugging Face Hub, except you can omit the token_type_ids parameter. 따라서 모델을 로드하고 해당 부분을 사용하지 않도록 제거해주어야한다. Pylate Sentence_Transformer 현재까지 테스트했던 모델들 중에서는 에러가 발생하는 경우가 없음.. 에러 발생시 바로 재작성 예정 MTEB-ColBERTWrapper yjoonjang님 코드 참조 더 확실한 방법은 huggingface model들의 tokenizer_config.json 을 확인해보면 알 수 있다. Ref https://huggingface.co/blog/modernbert
  • P
    paper Lee