from huggingface_hub import HfApi, HfFolder | |
# ํ ํฐ ๋ถ๋ฌ์ค๊ธฐ | |
token = HfFolder.get_token() | |
# HfApi ์ธ์คํด์ค ์์ฑ | |
api = HfApi() | |
# ์ ๋ก๋ํ ๊ฒฝ๋ก์ ๋ฆฌํฌ์งํ ๋ฆฌ ์ค์ | |
folder_path = "." # ํ์ฌ ๋๋ ํ ๋ฆฌ(./reranker-data) ๋ด ๋ชจ๋ ํ์ผ/ํด๋ | |
repo_id = "sigridjineth/ko-reranker-v1.1-preview" | |
repo_type = "model" # model, dataset, space ์ค ์ ํ. ํด๋น ๋ฆฌํฌ์งํ ๋ฆฌ ํ์ ์ ๋ง๊ฒ ์กฐ์ | |
# ํด๋ ์ ๋ก๋ | |
api.upload_folder( | |
folder_path=folder_path, | |
repo_id=repo_id, | |
repo_type=repo_type, | |
token=token | |
) | |