Spaces:
Sleeping
Sleeping
Commit ·
5cfc531
1
Parent(s): d434037
Add system
Browse files117 unmodified lines11811912012112212312442 unmodified lines1671681691701711721731743 unmodified lines17817918018118218318418518618780 unmodified lines2682692702712722732748 unmodified lines283284285286287288289290291292117 unmodified linesdata = request.get_json()claim = data.get("claim", "no input")time_range_option = data.get("time_range", "month")suggestion_meta = data.get("suggestion_meta")pledge_date = data.get("pledge_date", "")pledge_author = data.get("pledge_author", "")42 unmodified linesdf.to_json(json_path, orient="records", indent=2)now = datetime.now()now_iso = datetime.now().isoformat()events = df.to_dict(orient="records")log_entry = {3 unmodified lines"suggestion_meta": suggestion_meta,"time_start": time_start,"time_end": time_end,"pledge_author": pledge_author,"pledge_date": pledge_date,"events": events,"finish_time": now_iso}default_log_path = f"{FEEDBACK_DIR}/feedback_{timestamp}_{user_id}.jsonl"80 unmodified linestime_end = previous_log.get("time_end")pledge_author = previous_log.get("time_start")pledge_date = previous_log.get("time_end")finish_time = previous_log.get("finish_time")except Exception:pass8 unmodified lines"suggestion_meta": suggestion_meta,"time_start": time_start,"time_end": time_end,"pledge_author": pledge_author,"pledge_date": pledge_date,"events": events,"finish_time": finish_time}local_filename = f"{FEEDBACK_DIR}/feedback_{timestamp}_{user_id}.jsonl"117 unmodified lines11811912012112212312412542 unmodified lines1681691701711721731741751763 unmodified lines18018118218318418518618718818980 unmodified lines2702712722732742752768 unmodified lines285286287288289290291292293294117 unmodified linesdata = request.get_json()claim = data.get("claim", "no input")time_range_option = data.get("time_range", "month")system_start_time = datetime.now()system_start_time = datetime.system_start_time().isoformat()suggestion_meta = data.get("suggestion_meta")pledge_date = data.get("pledge_date", "")pledge_author = data.get("pledge_author", "")42 unmodified linesdf.to_json(json_path, orient="records", indent=2)system_end_time = datetime.now()system_end_time = datetime.system_end_time().isoformat()runtime = system_end_time - system_start_timeevents = df.to_dict(orient="records")log_entry = {3 unmodified lines"suggestion_meta": suggestion_meta,"time_start": time_start,"time_end": time_end,"runtime": runtime,"pledge_author": pledge_author,"pledge_date": pledge_date,"events": events}default_log_path = f"{FEEDBACK_DIR}/feedback_{timestamp}_{user_id}.jsonl"80 unmodified linestime_end = previous_log.get("time_end")pledge_author = previous_log.get("time_start")pledge_date = previous_log.get("time_end")runtime = previous_log.get("runtime")except Exception:pass8 unmodified lines"suggestion_meta": suggestion_meta,"time_start": time_start,"time_end": time_end,"runtime": runtime,"pledge_author": pledge_author,"pledge_date": pledge_date,"events": events}local_filename = f"{FEEDBACK_DIR}/feedback_{timestamp}_{user_id}.jsonl"
app.py+10-8