HuggingFace login 에러

2024. 11. 17. 22:27 · Python 및 Torch 코딩 이모저모
Exception has occurred: OSError
You are trying to access a gated repo.
Make sure to request access at https://huggingface.co/LDCC/LDCC-Instruct-Llama-2-ko-13B-v1.4 and pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`.
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/LDCC/LDCC-Instruct-Llama-2-ko-13B-v1.4/resolve/main/tokenizer_config.json

The above exception was the direct cause of the following exception:

huggingface_hub.utils._errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-65b0c2a4-2b36563c34034f1f35a70571;1e2fe910-5469-46b9-b027-fc09b3641ef8)

Cannot access gated repo for url https://huggingface.co/LDCC/LDCC-Instruct-Llama-2-ko-13B-v1.4/resolve/main/tokenizer_config.json.
Repo model LDCC/LDCC-Instruct-Llama-2-ko-13B-v1.4 is gated. You must be authenticated to access it.

The above exception was the direct cause of the following exception:

  File "/root/LLM_PEFT/peft_ldcc.py", line 162, in main
    tokenizer = AutoTokenizer.from_pretrained("LDCC/LDCC-Instruct-Llama-2-ko-13B-v1.4")
  File "/root/LLM_PEFT/peft_ldcc.py", line 234, in <module>
    main()
OSError: You are trying to access a gated repo.
Make sure to request access at https://huggingface.co/LDCC/LDCC-Instruct-Llama-2-ko-13B-v1.4 and pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`.

 

위와 같은 에러는 LLM 모델을 다운받을 때 huggingface 나 meta 등의 만든 회사 측의 승인이 필요한데 내가 승인이 안되어있거나 승인은 받았지만 huggingface 로그인이 터미널 상에서 안되어있을때 나타나는 에러이다.

 

이럴 때에는

(모델마다 승인을 받는 방식이 다른데, 보통은 허깅페이스 해당 모델 사이트에서 클릭만 하면 grant 를 얻을 수 있다)

 

HuggingFace 공식 사이트에 로그인 후 프로필 사진의 메뉴에서 Settings > Access Tokens 에 들어가면 자신의 token 을 복사할 수 있다. hf~ 꼴이다.

 

이후 돌리려고 하는 python 파일에 아래와 같이 기재해주면 된다!

from huggingface_hub import login

login("hf_XXXXXXXXXXX")

'Python 및 Torch 코딩 이모저모' 카테고리의 다른 글

device-side assert triggered error  (0) 2024.11.26
RuntimeError: The server socket has failed to listen on any local network address.  (1) 2024.11.20
git 사용법 5  (0) 2024.11.15
git 이용법 4  (0) 2024.11.14
Git 이용법 3  (0) 2024.11.13
'Python 및 Torch 코딩 이모저모' 카테고리의 다른 글
  • device-side assert triggered error
  • RuntimeError: The server socket has failed to listen on any local network address.
  • git 사용법 5
  • git 이용법 4
섬섬옥수수
섬섬옥수수
컴공 AI 개발자가 되기 위한 노역입니다
섬섬옥수수
아날로그 인간의 컴공 되기
섬섬옥수수
전체
오늘
어제
  • 분류 전체보기
    • 백준 단계별 코딩 테스트
    • KB 논문 정리
    • Memory network 논문 정리
    • LLM 관련 논문 정리
    • Python 및 Torch 코딩 이모저모
    • Clustering 관련 논문 정리
    • 머신러닝 이모저모
    • 암호학

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 이화여대
  • 오블완
  • 문제풀이
  • 코딩테스트
  • 백준
  • 소프트웨어
  • efficient and effective vocabulary expansion towards multilingual large language models
  • 티스토리챌린지
  • e5-v
  • PEFT
  • ragas
  • CUDA
  • vocabulary expansion
  • dependency tree
  • eeve
  • 인공지능융합기반시스템개론
  • 하드웨어
  • constituency tree
  • GIT
  • 심재형

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.0
섬섬옥수수
HuggingFace login 에러
상단으로

티스토리툴바

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.