eyad-silx commited on
Commit
ca7b2a1
·
verified ·
1 Parent(s): e70889d

Delete rl.py

Browse files
Files changed (1) hide show
  1. rl.py +0 -62
rl.py DELETED
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env python3
2
- import os
3
- from huggingface_hub import HfApi, create_repo, login
4
-
5
- def push_model_to_hub():
6
- # Set your Hugging Face credentials
7
- # You can get your token from https://huggingface.co/settings/tokens
8
- HF_TOKEN = input("Enter your Hugging Face token: ")
9
-
10
- # Repository details
11
- REPO_ID = "eyad-silx/Quasar-Deepseek-r1-dsttil-14B-TTM"
12
- LOCAL_DIR = "." # Current directory
13
-
14
- # Login to Hugging Face
15
- login(token=HF_TOKEN)
16
-
17
- print(f"Creating private repository {REPO_ID}...")
18
-
19
- # Create a new private repository
20
- create_repo(
21
- repo_id=REPO_ID,
22
- private=True, # Set to True for private repository
23
- exist_ok=True, # Won't fail if repo already exists
24
- repo_type="model"
25
- )
26
-
27
- # Initialize the Hugging Face API
28
- api = HfApi()
29
-
30
- # Get all files in the current directory without filtering
31
- files_to_upload = []
32
- for file in os.listdir(LOCAL_DIR):
33
- # Skip hidden files and directories
34
- if not file.startswith('.') and not os.path.isdir(os.path.join(LOCAL_DIR, file)):
35
- files_to_upload.append(os.path.join(LOCAL_DIR, file))
36
-
37
- print(f"Found {len(files_to_upload)} files to upload.")
38
-
39
- # Upload all files to the repository
40
- for i, file_path in enumerate(files_to_upload, 1):
41
- file_name = os.path.basename(file_path)
42
- print(f"[{i}/{len(files_to_upload)}] Uploading {file_name}...")
43
-
44
- api.upload_file(
45
- path_or_fileobj=file_path,
46
- path_in_repo=file_name,
47
- repo_id=REPO_ID,
48
- token=HF_TOKEN,
49
- )
50
-
51
- print(f"\nSuccess! Model uploaded to https://huggingface.co/{REPO_ID}")
52
- print("Note: Since it's a private repository, only you and collaborators can access it.")
53
-
54
- if __name__ == "__main__":
55
- # Check if huggingface_hub is installed
56
- try:
57
- import huggingface_hub
58
- except ImportError:
59
- print("Installing required package: huggingface_hub")
60
- os.system("pip install huggingface_hub")
61
-
62
- push_model_to_hub()