seawolf2357 commited on
Commit
2348476
1 Parent(s): 5088090

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -1,22 +1,21 @@
1
  from huggingface_hub import HfApi, HfFolder, Repository
2
  import os
 
3
 
4
- # Hugging Face 계정으로 로그인 (처음 실행 시 로그인 정보 입력)
5
- hf_username = "seawolf2357" # 여기에 Hugging Face 사용자 이름 입력
6
- repo_name = "your_repo_name" # 여기에 리포지토리 이름 입력 (없으면 생성됨)
7
- file_path = "your_file_path.mp4" # 업로드할 파일의 경로
8
-
9
- # API 초기화
10
  api = HfApi()
 
 
 
11
 
12
- # 리포지토리 생성 또는 선택
13
  repo_url = api.create_repo(
14
  repo_id=f"{hf_username}/{repo_name}",
15
- token=HfFolder.get_token(),
16
  private=False, # True로 설정하면 비공개 리포지토리 생성
17
  exist_ok=True # 이미 존재하는 경우 오류 방지
18
  )
19
 
 
20
  # 로컬에서 리포지토리 클론
21
  repo_local_path = "./" + repo_name
22
  repo = Repository(repo_local_path, clone_from=repo_url)
 
1
  from huggingface_hub import HfApi, HfFolder, Repository
2
  import os
3
+ from huggingface_hub import HfApi
4
 
 
 
 
 
 
 
5
  api = HfApi()
6
+ repo_name = "your_repo_name"
7
+ hf_username = "your_hf_username"
8
+ token = os.getenv("TOKEN")
9
 
10
+ # 리포지토리 생성
11
  repo_url = api.create_repo(
12
  repo_id=f"{hf_username}/{repo_name}",
13
+ token=token, # 토큰 추가
14
  private=False, # True로 설정하면 비공개 리포지토리 생성
15
  exist_ok=True # 이미 존재하는 경우 오류 방지
16
  )
17
 
18
+
19
  # 로컬에서 리포지토리 클론
20
  repo_local_path = "./" + repo_name
21
  repo = Repository(repo_local_path, clone_from=repo_url)