Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

저한테만 뜨는 에러인지 #47

Closed
airshin11 opened this issue Feb 10, 2021 · 2 comments
Closed

저한테만 뜨는 에러인지 #47

airshin11 opened this issue Feb 10, 2021 · 2 comments
Labels
question Further information is requested

Comments

@airshin11
Copy link

model, vocab = get_pytorch_kobert_model() 엔터하면

OSError: Not found: "C:\Users\etfffff/kobert/kobert_news_wiki_ko_cased-1087f8699e.spiece": Illegal byte sequence Error #42 이라는 에러코드가 뜨는데요

@Minku-Koo
Copy link

Minku-Koo commented May 17, 2021

KoBERT 설치 경로에 한글이 포함되어 나오는 에러 같습니다.
https://tech-diary.tistory.com/26 참고해보세요.

해결 방법 공유합니다. (위 링크와 동일 내용)

  1. kobert가 설치되어있는 파일을 찾아갑니다.
    예시) C:/Users/사용자/kobert/

  2. kobert_news_wiki_ko_cased-1087f8699e.spiece 파일을 한글 경로가 없는 곳으로 복사해줍니다.
    예시) 한글 경로가 포함되지 않은 "C 드라이브"로 옯겨줍니다.

  3. sentencepiece 라이브러리 설치 경로로 이동
    예시) C:/ProgramData/Anaconda3/lib/site-packages/sentencepiece/init.py

  4. init.py 파일을 열어서 171 라인을 수정해줍니다.
    (기존)

return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)

(수정)

try:
    arg = arg.replace("\\","/") # 파일 경로 구분자를 통일시켜줍니다.
    return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
except OSError:
    # 2번에서 파일을 복사한 디렉터리의 경로를 path에 적어줍니다.
    path = "C:/" #예시
    arg = path + arg.split("/")[-1]
    return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)

@haven-jeon haven-jeon added the question Further information is requested label May 18, 2021
@haven-jeon
Copy link
Collaborator

감사합니다. 도움이 된거 같습니다. 해당 이슈는 클로즈 하겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants