본문 바로가기

NLP/huggingface

[huggingface🤗] OSError: You are trying to access a gated repo

문제

  • huggingface 에서 허가받아야 하는 저장소에 신원을 밝히지 않고 접근한 경우
  • 신원 확인 전까지는 막힌다

 

해결책

  • huggingface 홈페이지에 로그인해서 내 설정에 가서 토큰을 생성한다

 

huggingface-cli login
  • 위 명령어를 터미널에 치면, 토큰을 입력하라고 한다
  • 그러면 아까 생성한 토큰을 복사해서 입력한다

 

 

다른 방법들은 아래 링크에 많다.

코드 내에서 입력하는 방법도 있는데 그냥 터미널에 로그인해두면 얼마나 편해...

 

 

https://huggingface.co/docs/huggingface_hub/quick-start

 

Quickstart

The Hugging Face Hub is the go-to place for sharing machine learning models, demos, datasets, and metrics. huggingface_hub library helps you interact with the Hub without leaving your development environment. You can create and manage repositories easily,

huggingface.co