Upload calculation\upl.py with huggingface_hub
Browse files- calculation//upl.py +17 -0
calculation//upl.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import HfApi
|
| 2 |
+
from huggingface_hub.utils import enable_progress_bars
|
| 3 |
+
enable_progress_bars()
|
| 4 |
+
api = HfApi()
|
| 5 |
+
|
| 6 |
+
repo_id = "OzoneAsai/calculation"
|
| 7 |
+
|
| 8 |
+
for i in range(1, 60):
|
| 9 |
+
input_file_path = f"./output{str(i)}.json"
|
| 10 |
+
output_file_path = f"output{str(i)}.json"
|
| 11 |
+
|
| 12 |
+
api.upload_file(
|
| 13 |
+
path_or_fileobj=input_file_path,
|
| 14 |
+
path_in_repo=output_file_path,
|
| 15 |
+
repo_id=repo_id,
|
| 16 |
+
repo_type="dataset",
|
| 17 |
+
)
|