Sam Chaudry
commited on
Upload folder using huggingface_hub
Browse files- .huggingfaceignore +2 -1
- upload_to_huggingface.py +2 -22
.huggingfaceignore
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
# Ignore virtual environments
|
2 |
-
venv
|
|
|
3 |
|
4 |
# Ignore cache and large files
|
5 |
__pycache__/
|
|
|
1 |
# Ignore virtual environments
|
2 |
+
venv/
|
3 |
+
.env/
|
4 |
|
5 |
# Ignore cache and large files
|
6 |
__pycache__/
|
upload_to_huggingface.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from huggingface_hub import login, create_repo,
|
2 |
import os
|
3 |
|
4 |
token = os.getenv("HF_TOKEN")
|
@@ -9,30 +9,10 @@ repo_id = "NeuralNap/spam-classifier"
|
|
9 |
|
10 |
create_repo(repo_id, private=False, exist_ok=True)
|
11 |
|
12 |
-
|
13 |
repo_id=repo_id,
|
14 |
folder_path=".",
|
15 |
repo_type="model",
|
16 |
-
ignore_patterns=[
|
17 |
-
"venv",
|
18 |
-
"venv/*",
|
19 |
-
".env",
|
20 |
-
"__pycache__",
|
21 |
-
"__pycache__/*",
|
22 |
-
"*.pyc",
|
23 |
-
"*.pkl",
|
24 |
-
"*.ipynb",
|
25 |
-
"tests",
|
26 |
-
"tests/*",
|
27 |
-
".DS_Store",
|
28 |
-
".vscode",
|
29 |
-
".vscode/*",
|
30 |
-
"cache",
|
31 |
-
"cache/*",
|
32 |
-
".git",
|
33 |
-
".git/*",
|
34 |
-
"*.log"
|
35 |
-
]
|
36 |
)
|
37 |
|
38 |
|
|
|
1 |
+
from huggingface_hub import login, create_repo, upload_folder
|
2 |
import os
|
3 |
|
4 |
token = os.getenv("HF_TOKEN")
|
|
|
9 |
|
10 |
create_repo(repo_id, private=False, exist_ok=True)
|
11 |
|
12 |
+
upload_folder(
|
13 |
repo_id=repo_id,
|
14 |
folder_path=".",
|
15 |
repo_type="model",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
)
|
17 |
|
18 |
|