jayesh20 commited on
Commit
eb7ccc0
·
verified ·
1 Parent(s): 232b931

Upload folder using huggingface_hub

Browse files
.virtual_documents/__notebook_source__.ipynb ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ get_ipython().getoutput("pip install -q huggingface_hub")
2
+
3
+ from huggingface_hub import login
4
+ from kaggle_secrets import UserSecretsClient
5
+
6
+ # "HF_TOKEN" here is the LABEL you set in Add-ons -> Secrets, not the token itself
7
+ hf_token = UserSecretsClient().get_secret("HF_TOKEN")
8
+ login(token=hf_token)
9
+
10
+
11
+ get_ipython().getoutput("kaggle kernels output mickey2004/complete-fakeddit-image -p "/kaggle/working/"")
12
+
13
+
14
+ from huggingface_hub import HfApi, create_repo
15
+
16
+ repo_id = "jayesh20/ai-image-detector" # change this
17
+ api = HfApi()
18
+
19
+ # Create the repo (safe to call even if it already exists)
20
+ create_repo(repo_id, repo_type="model", exist_ok=True, private=False)
21
+
22
+ # Upload a single checkpoint file
23
+ api.upload_file(
24
+ path_or_fileobj="/kaggle/working/best_clip_detector.pth",
25
+ path_in_repo="best_clip_detector.pth",
26
+ repo_id=repo_id,
27
+ repo_type="model",
28
+ )
29
+
30
+
31
+
32
+ api.upload_folder(
33
+ folder_path="/kaggle/working/",
34
+ repo_id=repo_id,
35
+ repo_type="model",
36
+ path_in_repo=".", # or "stage1/" to keep it in a subfolder
37
+ )
38
+
39
+
40
+
checkpoint.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cb6be38a6eb890d5db0f50360eeaf1d8ca95927661d16519eaaad4afe31595f
3
+ size 610403840
checkpoint_epoch_17.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f371a25b6d166f7e3fd37f95c8f624f07e08a25936059f883f7001bdc4f90dc0
3
+ size 606965113
complete-fakeddit-image.log ADDED
The diff for this file is too large to render. See raw diff