Spaces:
Running
Running
Trying to activate backup
Browse files
main.py
CHANGED
@@ -27,7 +27,7 @@ assert HF_DATASET_AUTH_TOKEN != "none", "Please set the corrent ENV variables!!!
|
|
27 |
|
28 |
LOCAL_STORAGE_PATH = ""
|
29 |
|
30 |
-
FILE_EVENTS = f"events-{datetime.utcnow()}-{uuid4()}.
|
31 |
|
32 |
if "localhost" in SPACE_HOST:
|
33 |
DATABASE_NAME = "data/sessions_meta.db"
|
@@ -43,18 +43,19 @@ EVENTS_FILE_PATH = LOCAL_STORAGE_PATH / FILE_EVENTS
|
|
43 |
|
44 |
|
45 |
scheduler = None
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
58 |
|
59 |
|
60 |
global_database = Database(DATABASE_NAME)
|
|
|
27 |
|
28 |
LOCAL_STORAGE_PATH = ""
|
29 |
|
30 |
+
FILE_EVENTS = f"events-{datetime.utcnow()}-{uuid4()}.jsonl"
|
31 |
|
32 |
if "localhost" in SPACE_HOST:
|
33 |
DATABASE_NAME = "data/sessions_meta.db"
|
|
|
43 |
|
44 |
|
45 |
scheduler = None
|
46 |
+
try:
|
47 |
+
scheduler = CommitScheduler(
|
48 |
+
repo_id="ml-visoft/c-reviewer",
|
49 |
+
repo_type="dataset",
|
50 |
+
folder_path=LOCAL_STORAGE_PATH,
|
51 |
+
every=5,
|
52 |
+
path_in_repo="raw_data",
|
53 |
+
token=HF_DATASET_AUTH_TOKEN,
|
54 |
+
squash_history=False
|
55 |
+
)
|
56 |
+
except:
|
57 |
+
import traceback
|
58 |
+
traceback.print_exc()
|
59 |
|
60 |
|
61 |
global_database = Database(DATABASE_NAME)
|