Studytime171 commited on
Commit
e2fff2f
·
verified ·
1 Parent(s): f87d166

Create 1.py

Browse files
Files changed (1) hide show
  1. 1.py +39 -0
1.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import HfApi
2
+
3
+ # --- CONFIGURATION ---
4
+ # 1. Hugging Face Settings se 'Write' Token yahan copy-paste karein
5
+ #HF_TOKEN = "PASTE_YOUR_WRITE_TOKEN_HERE"
6
+
7
+ # 2. Aapka Repo ID (Screenshot ke mutabiq)
8
+ REPO_ID = "Studytime171/lalit"
9
+
10
+ # 3. Archive Link aur File Name
11
+ FILE_URL = "https://archive.org/download/windows-7x-86-supernano-final/Windows7SuperNanoLite.iso"
12
+ FILE_NAME = "Windows7SuperNanoLite.iso"
13
+
14
+ def start_remote_upload():
15
+ #api = HfApi(token=HF_TOKEN)
16
+
17
+ print(f"Starting remote transfer to {REPO_ID}...")
18
+
19
+ try:
20
+ # Ye command direct server-to-server transfer karegi
21
+ api.add_from_url(
22
+ url=FILE_URL,
23
+ path_in_repo=FILE_NAME,
24
+ repo_id=REPO_ID,
25
+ repo_type="space" # Kyunki aap 'Space' use kar rahe hain
26
+ )
27
+
28
+ print("-" * 30)
29
+ print("SUCCESS: Remote transfer trigger ho gaya hai!")
30
+ print(f"Check progress here: https://huggingface.co/spaces/{REPO_ID}/tree/main")
31
+ print("-" * 30)
32
+ print("Ab aap browser band kar sakte hain, transfer background mein chalta rahega.")
33
+
34
+ except Exception as e:
35
+ print(f"Error: {e}")
36
+ print("Check karein ki aapka Token 'Write' permission wala hai ya nahi.")
37
+
38
+ if __name__ == "__main__":
39
+ start_remote_upload()