티스토리 뷰

# jupyter notebook에서 hugging face 로그인

from huggingface_hub import notebook_login
 
notebook_login()

 

# repository 생성 / 삭제

from huggingface_hub import create_repo
 
# Repository 생성
create_repo(name=REPO_NAME)
 
# Repository 삭제
delete_repo(name=REPO_NAME)

 

# 원격 저장소 clone

from huggingface_hub import Repository

# LOCAL_DIR_NAME : 저장할 로컬 저장소 이름
# NAMESPACE/REPO_NAME : huggingface의 repository 이름
repo = Repository(LOCAL_DIR_NAME, clone_from=NAMESPACE/REPO_NAME)

# git clone https://huggingface.co/username/repository_name

 

 

# 내가 로컬에서 train한 model을 clone한 폴더로 옮긴 뒤, git으로 push

!cp -r model/* LOCAL_DIR_NAME
repo.git_add()
repo.git_commit('update model') # 커밋메시지 작성
repo.git_push()

'NLP' 카테고리의 다른 글

huggingface Transformer 학습 시 생성되는 checkpoint  (1) 2024.04.01
tokenizer train  (0) 2024.03.29
[NLP] gensim Word2Vec을 이용한 embedding vector train  (0) 2023.03.26
[NLP] word embedding - CBOW  (0) 2023.03.04
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/02   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
글 보관함