Sam Chaudry
commited on
Upload folder using huggingface_hub
Browse files- .huggingfaceignore +0 -9
- upload_to_huggingface.py +4 -3
.huggingfaceignore
CHANGED
@@ -1,14 +1,5 @@
|
|
1 |
-
# Ignore virtual environments
|
2 |
venv/
|
3 |
.env/
|
4 |
-
|
5 |
-
# Ignore cache and large files
|
6 |
__pycache__/
|
7 |
*.pyc
|
8 |
-
*.pkl
|
9 |
-
*.csv
|
10 |
*.log
|
11 |
-
|
12 |
-
# Ignore system or IDE files
|
13 |
-
.DS_Store
|
14 |
-
.vscode/
|
|
|
|
|
1 |
venv/
|
2 |
.env/
|
|
|
|
|
3 |
__pycache__/
|
4 |
*.pyc
|
|
|
|
|
5 |
*.log
|
|
|
|
|
|
|
|
upload_to_huggingface.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
-
from huggingface_hub import
|
2 |
import os
|
3 |
|
|
|
4 |
token = os.getenv("HF_TOKEN")
|
5 |
login(token=token)
|
6 |
|
7 |
-
#
|
8 |
repo_id = "NeuralNap/spam-classifier"
|
9 |
create_repo(repo_id, private=False, exist_ok=True)
|
10 |
|
11 |
upload_folder(
|
12 |
-
folder_path=".",
|
13 |
repo_id=repo_id,
|
|
|
14 |
repo_type="model"
|
15 |
)
|
|
|
1 |
+
from huggingface_hub import login, create_repo, upload_folder
|
2 |
import os
|
3 |
|
4 |
+
# Login with the token
|
5 |
token = os.getenv("HF_TOKEN")
|
6 |
login(token=token)
|
7 |
|
8 |
+
# Create the repo (if it doesn't exist)
|
9 |
repo_id = "NeuralNap/spam-classifier"
|
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 |
)
|