Spaces:
Sleeping
Sleeping
Commit
·
6101e3a
1
Parent(s):
68eccea
Add system
Browse files
app.py
CHANGED
|
@@ -159,14 +159,17 @@ def run_model():
|
|
| 159 |
|
| 160 |
outputs = run_pipeline(
|
| 161 |
claim, pledge_date, pledge_author, time_start, timestamp, user_id,
|
| 162 |
-
update_fn=
|
| 163 |
)
|
| 164 |
|
| 165 |
df = pd.read_excel(outputs["sorted_events"])
|
| 166 |
json_path = os.path.join(TMP_DIR, f"{timestamp}_{user_id}.json")
|
| 167 |
df.to_json(json_path, orient="records", indent=2)
|
|
|
|
| 168 |
|
| 169 |
now = datetime.now()
|
|
|
|
|
|
|
| 170 |
events = df.to_dict(orient="records")
|
| 171 |
log_entry = {
|
| 172 |
"requested_time": timestamp,
|
|
@@ -178,7 +181,7 @@ def run_model():
|
|
| 178 |
"pledge_author": pledge_author,
|
| 179 |
"pledge_date": pledge_date,
|
| 180 |
"events": events,
|
| 181 |
-
"finish_time":
|
| 182 |
}
|
| 183 |
default_log_path = f"{FEEDBACK_DIR}/feedback_{timestamp}_{user_id}.jsonl"
|
| 184 |
|
|
@@ -265,7 +268,7 @@ def receive_feedback():
|
|
| 265 |
time_end = previous_log.get("time_end")
|
| 266 |
pledge_author = previous_log.get("time_start")
|
| 267 |
pledge_date = previous_log.get("time_end")
|
| 268 |
-
finish_time =
|
| 269 |
except Exception:
|
| 270 |
pass
|
| 271 |
|
|
|
|
| 159 |
|
| 160 |
outputs = run_pipeline(
|
| 161 |
claim, pledge_date, pledge_author, time_start, timestamp, user_id,
|
| 162 |
+
update_fn=update_status, suggestion_meta=suggestion_meta
|
| 163 |
)
|
| 164 |
|
| 165 |
df = pd.read_excel(outputs["sorted_events"])
|
| 166 |
json_path = os.path.join(TMP_DIR, f"{timestamp}_{user_id}.json")
|
| 167 |
df.to_json(json_path, orient="records", indent=2)
|
| 168 |
+
|
| 169 |
|
| 170 |
now = datetime.now()
|
| 171 |
+
now_iso = datetime.now().isoformat()
|
| 172 |
+
|
| 173 |
events = df.to_dict(orient="records")
|
| 174 |
log_entry = {
|
| 175 |
"requested_time": timestamp,
|
|
|
|
| 181 |
"pledge_author": pledge_author,
|
| 182 |
"pledge_date": pledge_date,
|
| 183 |
"events": events,
|
| 184 |
+
"finish_time": now_iso
|
| 185 |
}
|
| 186 |
default_log_path = f"{FEEDBACK_DIR}/feedback_{timestamp}_{user_id}.jsonl"
|
| 187 |
|
|
|
|
| 268 |
time_end = previous_log.get("time_end")
|
| 269 |
pledge_author = previous_log.get("time_start")
|
| 270 |
pledge_date = previous_log.get("time_end")
|
| 271 |
+
finish_time = prev_log.get("finish_time")
|
| 272 |
except Exception:
|
| 273 |
pass
|
| 274 |
|