Upload wandbsync.py with huggingface_hub
Browse files- wandbsync.py +19 -0
wandbsync.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
+
|
| 3 |
+
# Path to the offline runs directory
|
| 4 |
+
offline_runs_dir = "./wandb" # Update this to your actual path if needed
|
| 5 |
+
|
| 6 |
+
# Sync all offline runs with verbose output
|
| 7 |
+
try:
|
| 8 |
+
result = subprocess.run(
|
| 9 |
+
["python", "-m", "wandb", "sync", "--sync-all", "--verbose", offline_runs_dir],
|
| 10 |
+
capture_output=True,
|
| 11 |
+
text=True,
|
| 12 |
+
check=True,
|
| 13 |
+
)
|
| 14 |
+
print("Output:\n", result.stdout)
|
| 15 |
+
print("Errors (if any):\n", result.stderr)
|
| 16 |
+
except subprocess.CalledProcessError as e:
|
| 17 |
+
print("An error occurred while syncing:")
|
| 18 |
+
print(e.stdout)
|
| 19 |
+
print(e.stderr)
|