Tim Luka Horstmann
commited on
Commit
·
b77d28c
1
Parent(s):
051899e
added date
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
# app.py
|
2 |
|
|
|
3 |
import json
|
4 |
import time
|
5 |
import numpy as np
|
@@ -104,6 +105,8 @@ def stream_response(query):
|
|
104 |
logger.info(f"Processing query: {query}")
|
105 |
start_time = time.time()
|
106 |
first_token_logged = False
|
|
|
|
|
107 |
|
108 |
# FAQ check first (keep this as it's fast)
|
109 |
# query_embedding = embedder.encode(query, convert_to_numpy=True).astype("float32")
|
@@ -126,6 +129,7 @@ def stream_response(query):
|
|
126 |
"For questions about your CV, base your answer *exclusively* on the provided CV information below and do not add any details not explicitly stated. "
|
127 |
"For casual questions not covered by the CV, respond naturally but limit answers to general truths about yourself (e.g., your current location is Paris, France, or your field is AI) "
|
128 |
"and say 'I don't have specific details to share about that' if pressed for specifics beyond the CV or FAQs. Do not invent facts, experiences, or opinions not supported by the CV or FAQs. "
|
|
|
129 |
f"CV: {full_cv_text}"
|
130 |
)
|
131 |
},
|
|
|
1 |
# app.py
|
2 |
|
3 |
+
from datetime import datetime
|
4 |
import json
|
5 |
import time
|
6 |
import numpy as np
|
|
|
105 |
logger.info(f"Processing query: {query}")
|
106 |
start_time = time.time()
|
107 |
first_token_logged = False
|
108 |
+
|
109 |
+
current_date = datetime.now().strftime("%Y-%m-%d")
|
110 |
|
111 |
# FAQ check first (keep this as it's fast)
|
112 |
# query_embedding = embedder.encode(query, convert_to_numpy=True).astype("float32")
|
|
|
129 |
"For questions about your CV, base your answer *exclusively* on the provided CV information below and do not add any details not explicitly stated. "
|
130 |
"For casual questions not covered by the CV, respond naturally but limit answers to general truths about yourself (e.g., your current location is Paris, France, or your field is AI) "
|
131 |
"and say 'I don't have specific details to share about that' if pressed for specifics beyond the CV or FAQs. Do not invent facts, experiences, or opinions not supported by the CV or FAQs. "
|
132 |
+
f"Today’s date is {current_date}. "
|
133 |
f"CV: {full_cv_text}"
|
134 |
)
|
135 |
},
|