add timestamp
Browse files- sync_data.sh +6 -1
sync_data.sh
CHANGED
|
@@ -20,10 +20,15 @@ import os
|
|
| 20 |
import sys
|
| 21 |
import hashlib
|
| 22 |
import shutil
|
|
|
|
|
|
|
| 23 |
from huggingface_hub import HfApi, CommitOperationAdd, CommitOperationDelete
|
| 24 |
|
|
|
|
|
|
|
| 25 |
def log_print(*args, prefix="[SyncData]", **kwargs):
|
| 26 |
-
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
def calculate_file_hash(file_path):
|
|
|
|
| 20 |
import sys
|
| 21 |
import hashlib
|
| 22 |
import shutil
|
| 23 |
+
from datetime import datetime
|
| 24 |
+
from zoneinfo import ZoneInfo
|
| 25 |
from huggingface_hub import HfApi, CommitOperationAdd, CommitOperationDelete
|
| 26 |
|
| 27 |
+
SHANG_HAI_TZ = ZoneInfo("Asia/Shanghai")
|
| 28 |
+
|
| 29 |
def log_print(*args, prefix="[SyncData]", **kwargs):
|
| 30 |
+
timestamp = datetime.now(SHANG_HAI_TZ).strftime("%Y-%m-%d %H:%M:%S")
|
| 31 |
+
print(f"[{timestamp}]",prefix, *args, **kwargs)
|
| 32 |
|
| 33 |
|
| 34 |
def calculate_file_hash(file_path):
|