Upload src/upload_to_hf.py with huggingface_hub
Browse files- src/upload_to_hf.py +6 -6
src/upload_to_hf.py
CHANGED
|
@@ -62,13 +62,13 @@ def upload_to_huggingface(repo_name, token):
|
|
| 62 |
repo_type="model"
|
| 63 |
)
|
| 64 |
|
| 65 |
-
# Upload
|
| 66 |
-
|
| 67 |
-
for
|
| 68 |
-
print(f"Uploading {
|
| 69 |
api.upload_file(
|
| 70 |
-
path_or_fileobj=
|
| 71 |
-
path_in_repo=f"
|
| 72 |
repo_id=repo_name,
|
| 73 |
repo_type="model"
|
| 74 |
)
|
|
|
|
| 62 |
repo_type="model"
|
| 63 |
)
|
| 64 |
|
| 65 |
+
# Upload all tokenizer files from cbow directory
|
| 66 |
+
cbow_files = glob.glob('cbow/*.pkl')
|
| 67 |
+
for cbow_file in cbow_files:
|
| 68 |
+
print(f"Uploading {cbow_file}...")
|
| 69 |
api.upload_file(
|
| 70 |
+
path_or_fileobj=cbow_file,
|
| 71 |
+
path_in_repo=f"cbow/{os.path.basename(cbow_file)}",
|
| 72 |
repo_id=repo_name,
|
| 73 |
repo_type="model"
|
| 74 |
)
|