Splend1dchan
commited on
Commit
•
1a10c09
1
Parent(s):
61eef45
Upload ./upload.py with huggingface_hub
Browse files
upload.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import create_repo
|
2 |
+
import os
|
3 |
+
try:
|
4 |
+
create_repo(f"Splend1dchan/Reddit_showerthought", repo_type="dataset", private=True)
|
5 |
+
except:
|
6 |
+
pass
|
7 |
+
|
8 |
+
from huggingface_hub import HfApi
|
9 |
+
api = HfApi()
|
10 |
+
for r, ds, fs in os.walk("./"):
|
11 |
+
for f in fs:
|
12 |
+
fname = os.path.join(r,f)
|
13 |
+
api.upload_file(
|
14 |
+
path_or_fileobj=fname,
|
15 |
+
path_in_repo=fname,
|
16 |
+
repo_id="Splend1dchan/Reddit_showerthought",
|
17 |
+
repo_type="dataset",
|
18 |
+
)
|