mtyrrell commited on
Commit
3ce59a7
·
1 Parent(s): a92e5cd

geolocation, session finalized

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. logs/app.log +77 -0
app.py CHANGED
@@ -217,8 +217,8 @@ async def chat(query, history, sources, reports, subtype, year, client_ip=None,
217
  timestamp = str(datetime.now().timestamp())
218
  logs_data = {
219
  "session_id": session_id,
220
- "client_location": session_data['location_info'],
221
  "session_duration_seconds": session_duration,
 
222
  # "system_prompt": SYSTEM_PROMPT, #REMOVED FOR TESTING
223
  # "sources": sources, #REMOVED FOR TESTING
224
  # "reports": reports, #REMOVED FOR TESTING
 
217
  timestamp = str(datetime.now().timestamp())
218
  logs_data = {
219
  "session_id": session_id,
 
220
  "session_duration_seconds": session_duration,
221
+ "client_location": session_data['location_info'],
222
  # "system_prompt": SYSTEM_PROMPT, #REMOVED FOR TESTING
223
  # "sources": sources, #REMOVED FOR TESTING
224
  # "reports": reports, #REMOVED FOR TESTING
logs/app.log CHANGED
@@ -1406,3 +1406,80 @@ Make sure your token has the correct permissions.
1406
  2025-02-13 15:06:39,048 - auditqa.utils - INFO - logging done
1407
  2025-02-13 15:06:39,049 - __main__ - DEBUG - Logs saved successfully
1408
  2025-02-13 15:06:41,719 - auditqa.utils - INFO - logging done
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1406
  2025-02-13 15:06:39,048 - auditqa.utils - INFO - logging done
1407
  2025-02-13 15:06:39,049 - __main__ - DEBUG - Logs saved successfully
1408
  2025-02-13 15:06:41,719 - auditqa.utils - INFO - logging done
1409
+ 2025-02-13 15:13:20,666 - datasets - INFO - PyTorch version 2.4.0 available.
1410
+ 2025-02-13 15:13:20,762 - sentence_transformers.SentenceTransformer - INFO - Load pretrained SentenceTransformer: BAAI/bge-large-en-v1.5
1411
+ 2025-02-13 15:13:22,445 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
1412
+ 2025-02-13 15:13:22,446 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
1413
+ 2025-02-13 15:13:22,459 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
1414
+ 2025-02-13 15:13:23,028 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
1415
+ 2025-02-13 15:13:36,657 - __main__ - DEBUG - Created new session: 82a34c8a-dfb1-43f6-a083-6d12c09d416c
1416
+ 2025-02-13 15:13:36,657 - __main__ - DEBUG - Session duration calculated: 4e-06
1417
+ 2025-02-13 15:13:36,658 - auditqa.retriever - INFO - Retriever activated
1418
+ 2025-02-13 15:13:37,787 - sentence_transformers.cross_encoder.CrossEncoder - INFO - Use pytorch device: mps
1419
+ 2025-02-13 15:13:40,162 - httpx - INFO - HTTP Request: POST https://ff3f0448-0a00-470e-9956-49efa3071db3.europe-west3-0.gcp.cloud.qdrant.io:6333/collections/allreports/points/search "HTTP/1.1 200 OK"
1420
+ 2025-02-13 15:13:42,640 - auditqa.retriever - INFO - retrieved paragraphs:3
1421
+ 2025-02-13 15:13:42,863 - __main__ - DEBUG - Logs data before save: {
1422
+ "session_id": "82a34c8a-dfb1-43f6-a083-6d12c09d416c",
1423
+ "client_location": {
1424
+ "city": null,
1425
+ "region": null,
1426
+ "country": null,
1427
+ "latitude": null,
1428
+ "longitude": null
1429
+ },
1430
+ "session_duration_seconds": 4e-06,
1431
+ "year": [
1432
+ "2023"
1433
+ ],
1434
+ "question": "What are the key findings of this audit report?",
1435
+ "retriever": "BAAI/bge-large-en-v1.5",
1436
+ "endpoint_type": "DEDICATED",
1437
+ "reader": "meta-llama/Llama-3.1-8B-Instruct",
1438
+ "answer": "",
1439
+ "time": "1739459622.863422"
1440
+ }
1441
+ 2025-02-13 15:13:42,864 - auditqa.reader - INFO - Serverless endpoint activated
1442
+ 2025-02-13 15:13:42,864 - auditqa.reader - INFO - Initializing InferenceClient with model: meta-llama/Meta-Llama-3-8B-Instruct
1443
+ 2025-02-13 15:13:42,864 - auditqa.reader - INFO - Serverless InferenceClient initialization successful
1444
+ 2025-02-13 15:13:56,457 - auditqa.utils - INFO - logging done
1445
+ 2025-02-13 15:13:56,458 - __main__ - DEBUG - Logs saved successfully
1446
+ 2025-02-13 15:13:59,999 - auditqa.utils - INFO - logging done
1447
+ 2025-02-13 15:14:50,196 - __main__ - DEBUG - Updated existing session: 82a34c8a-dfb1-43f6-a083-6d12c09d416c
1448
+ 2025-02-13 15:14:50,198 - __main__ - DEBUG - Session duration calculated: 73.851812
1449
+ 2025-02-13 15:14:50,201 - auditqa.retriever - INFO - Retriever activated
1450
+ 2025-02-13 15:14:51,351 - sentence_transformers.cross_encoder.CrossEncoder - INFO - Use pytorch device: mps
1451
+ 2025-02-13 15:14:54,076 - httpx - INFO - HTTP Request: POST https://ff3f0448-0a00-470e-9956-49efa3071db3.europe-west3-0.gcp.cloud.qdrant.io:6333/collections/allreports/points/search "HTTP/1.1 200 OK"
1452
+ 2025-02-13 15:14:56,916 - auditqa.retriever - INFO - retrieved paragraphs:3
1453
+ 2025-02-13 15:14:57,101 - __main__ - DEBUG - Logs data before save: {
1454
+ "session_id": "82a34c8a-dfb1-43f6-a083-6d12c09d416c",
1455
+ "client_location": {
1456
+ "city": null,
1457
+ "region": null,
1458
+ "country": null,
1459
+ "latitude": null,
1460
+ "longitude": null
1461
+ },
1462
+ "session_duration_seconds": 73.851812,
1463
+ "year": [
1464
+ "2023"
1465
+ ],
1466
+ "question": "Did this audit highlight any issues with financial management or budgeting?",
1467
+ "retriever": "BAAI/bge-large-en-v1.5",
1468
+ "endpoint_type": "DEDICATED",
1469
+ "reader": "meta-llama/Llama-3.1-8B-Instruct",
1470
+ "answer": "",
1471
+ "time": "1739459697.101206"
1472
+ }
1473
+ 2025-02-13 15:14:57,101 - auditqa.reader - INFO - Serverless endpoint activated
1474
+ 2025-02-13 15:14:57,101 - auditqa.reader - INFO - Initializing InferenceClient with model: meta-llama/Meta-Llama-3-8B-Instruct
1475
+ 2025-02-13 15:14:57,101 - auditqa.reader - INFO - Serverless InferenceClient initialization successful
1476
+ 2025-02-13 15:15:20,581 - auditqa.utils - INFO - logging done
1477
+ 2025-02-13 15:15:20,582 - __main__ - DEBUG - Logs saved successfully
1478
+ 2025-02-13 15:15:22,377 - auditqa.utils - INFO - logging done
1479
+ 2025-02-13 15:17:33,755 - huggingface_hub.hf_api - WARNING - No files have been modified since last commit. Skipping to prevent empty commit.
1480
+ 2025-02-13 15:17:34,408 - datasets - INFO - PyTorch version 2.4.0 available.
1481
+ 2025-02-13 15:17:34,509 - sentence_transformers.SentenceTransformer - INFO - Load pretrained SentenceTransformer: BAAI/bge-large-en-v1.5
1482
+ 2025-02-13 15:17:36,305 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
1483
+ 2025-02-13 15:17:36,320 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
1484
+ 2025-02-13 15:17:36,332 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
1485
+ 2025-02-13 15:17:36,886 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"