ml-visoft commited on
Commit
15040e6
1 Parent(s): 0a37d00

Trying to activate backup

Browse files
Files changed (1) hide show
  1. main.py +14 -13
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()}.json"
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
- # scheduler = CommitScheduler(
48
- # repo_id="ml-visoft/c-reviewer",
49
- # repo_type="dataset",
50
- # folder_path=LOCAL_STORAGE_PATH,
51
- # every=100,
52
- # path_in_repo="raw_data",
53
- # token=HF_DATASET_AUTH_TOKEN,
54
- # allow_patterns=".jslines",
55
- # squash_history=False
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)