Spaces:
Sleeping
Sleeping
Update user_evaluation_variables.py
Browse files- user_evaluation_variables.py +11 -12
user_evaluation_variables.py
CHANGED
@@ -10,13 +10,13 @@ EVAL_DATABASE_DIR.mkdir(parents=True, exist_ok=True)
|
|
10 |
GEN_EVAL_DATABASE_PATH = EVAL_DATABASE_DIR / f"general_eval_database.yaml"
|
11 |
TASK_EVAL_DATABASE_PATH = EVAL_DATABASE_DIR / f"task_oriented_eval_database.yaml"
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
|
21 |
USERNAME = "ANONYMOUS"
|
22 |
EVAL_ID = None
|
@@ -137,9 +137,9 @@ def update_evaluation_table(evalType, debugging):
|
|
137 |
yamlData['evaluations']['username'][USERNAME][EVAL_ID] = newEvaluationData
|
138 |
if debugging:
|
139 |
st.write("NEW DATABASE ", yamlData['evaluations']['username'][USERNAME])
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
|
144 |
def reset_variables(evalType):
|
145 |
global USERNAME
|
@@ -201,5 +201,4 @@ def reset_variables(evalType):
|
|
201 |
TASK_CAPTIONS = None
|
202 |
TASK_COCOIDs = None
|
203 |
TASK_IMAGES_IN_UI = False
|
204 |
-
TASK_TARGET = None
|
205 |
-
|
|
|
10 |
GEN_EVAL_DATABASE_PATH = EVAL_DATABASE_DIR / f"general_eval_database.yaml"
|
11 |
TASK_EVAL_DATABASE_PATH = EVAL_DATABASE_DIR / f"task_oriented_eval_database.yaml"
|
12 |
|
13 |
+
EVAL_DATABASE_UPDATE_SCHEDULER = CommitScheduler(
|
14 |
+
repo_id="try-before-you-bias-data",
|
15 |
+
repo_type="dataset",
|
16 |
+
folder_path=EVAL_DATABASE_DIR,
|
17 |
+
path_in_repo="data",
|
18 |
+
every=3,
|
19 |
+
)
|
20 |
|
21 |
USERNAME = "ANONYMOUS"
|
22 |
EVAL_ID = None
|
|
|
137 |
yamlData['evaluations']['username'][USERNAME][EVAL_ID] = newEvaluationData
|
138 |
if debugging:
|
139 |
st.write("NEW DATABASE ", yamlData['evaluations']['username'][USERNAME])
|
140 |
+
with EVAL_DATABASE_UPDATE_SCHEDULER.lock:
|
141 |
+
with open(evalDataPath, 'w') as yaml_file:
|
142 |
+
yaml_file.write(yaml.dump(yamlData, default_flow_style=False))
|
143 |
|
144 |
def reset_variables(evalType):
|
145 |
global USERNAME
|
|
|
201 |
TASK_CAPTIONS = None
|
202 |
TASK_COCOIDs = None
|
203 |
TASK_IMAGES_IN_UI = False
|
204 |
+
TASK_TARGET = None
|
|