Spaces:
Sleeping
Sleeping
deploy at 2024-08-24 16:02:52.918408
Browse files
main.py
CHANGED
|
@@ -59,7 +59,7 @@ from typing import Tuple as T
|
|
| 59 |
from urllib.parse import quote
|
| 60 |
import uuid
|
| 61 |
|
| 62 |
-
DEV_MODE =
|
| 63 |
|
| 64 |
if DEV_MODE:
|
| 65 |
print("Running in DEV_MODE - Hot reload enabled")
|
|
@@ -296,7 +296,6 @@ def get(sess):
|
|
| 296 |
queries = [
|
| 297 |
"Breast Cancer Cells Feed on Cholesterol",
|
| 298 |
"Treating Asthma With Plants vs. Pills",
|
| 299 |
-
"Alkylphenol Endocrine Disruptors",
|
| 300 |
"Testing Turmeric on Smokers",
|
| 301 |
"The Role of Pesticides in Parkinson's Disease",
|
| 302 |
]
|
|
@@ -453,6 +452,9 @@ def replace_hi_with_strong(text):
|
|
| 453 |
|
| 454 |
|
| 455 |
def log_query_to_db(query, ranking, sess):
|
|
|
|
|
|
|
|
|
|
| 456 |
if 'user_id' not in sess:
|
| 457 |
sess['user_id'] = str(uuid.uuid4())
|
| 458 |
|
|
|
|
| 59 |
from urllib.parse import quote
|
| 60 |
import uuid
|
| 61 |
|
| 62 |
+
DEV_MODE = True
|
| 63 |
|
| 64 |
if DEV_MODE:
|
| 65 |
print("Running in DEV_MODE - Hot reload enabled")
|
|
|
|
| 296 |
queries = [
|
| 297 |
"Breast Cancer Cells Feed on Cholesterol",
|
| 298 |
"Treating Asthma With Plants vs. Pills",
|
|
|
|
| 299 |
"Testing Turmeric on Smokers",
|
| 300 |
"The Role of Pesticides in Parkinson's Disease",
|
| 301 |
]
|
|
|
|
| 452 |
|
| 453 |
|
| 454 |
def log_query_to_db(query, ranking, sess):
|
| 455 |
+
queries.insert(
|
| 456 |
+
Query(query=query, ranking=ranking, sess_id=sesskey, timestamp=int(time.time()))
|
| 457 |
+
)
|
| 458 |
if 'user_id' not in sess:
|
| 459 |
sess['user_id'] = str(uuid.uuid4())
|
| 460 |
|