1. 라이브러리 설치
pip install transformers
brew install git-lfs
brew install huggingface-cli
2. 라이브러리 설치 여부 확인
pip list | grep transformers
git-lfs version
huggingface-cli
3. huggingface에 로그인
huggingface-cli login
- 'write' permission의 access token 사용
- Access Tokens 권한의 범위
- https://huggingface.co/docs/hub/security-tokens
- read: tokens with this role can only be used to provide read access to repositories you could read. That includes public and private repositories that you, or an organization you’re a member of, own. Use this role if you only need to read content from the Hugging Face Hub (e.g. when downloading private models or doing inference).
- write: tokens with this role additionally grant write access to the repositories you have write access to. Use this token if you need to create or push content to a repository (e.g., when training a model or modifying a model card).
- Access Tokens 권한의 범위
4. huggingface hub 저장소 생성
huggingface-cli repo create [저장소 이름]
5. 로컬에 저장소 clone
git clone https://[사용자 이름]:[token]@huggingface.co/[사용자 이름]/[저장소 이름]
6. git user.email과 user.name 입력
git config --global user.email [huggingface 이메일]
git config --global user.name [사용자 이름]
7. huggingface에 공유할 파일을 clone해온 저장소 폴더로 이동
8. push
git lfs install
git add --all
git commit -m "my test model upload"
git push
'NLP' 카테고리의 다른 글
[NLP] RNN은 왜 활성화함수로 tanh를 사용할까? (0) | 2023.04.02 |
---|
댓글