Update app.py
Browse files
app.py
CHANGED
|
@@ -167,20 +167,20 @@ def predict(user_input,company):
|
|
| 167 |
"traceback": traceback.format_exc()
|
| 168 |
}
|
| 169 |
|
| 170 |
-
# Log safely
|
| 171 |
-
with scheduler.lock:
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
return prediction
|
| 184 |
|
| 185 |
examples = [
|
| 186 |
["What are the AWS policies and frameworks regarding AI ethics, governance, and responsible AI use as detailed in their 10-K reports?", "AWS"],
|
|
|
|
| 167 |
"traceback": traceback.format_exc()
|
| 168 |
}
|
| 169 |
|
| 170 |
+
# Log safely
|
| 171 |
+
with scheduler.lock:
|
| 172 |
+
with log_file.open("a") as f:
|
| 173 |
+
f.write(json.dumps(
|
| 174 |
+
{
|
| 175 |
+
'user_input': user_input,
|
| 176 |
+
'retrieved_context': context_for_query,
|
| 177 |
+
'model_response': prediction
|
| 178 |
+
},
|
| 179 |
+
indent=2
|
| 180 |
+
))
|
| 181 |
+
f.write("\n")
|
| 182 |
+
|
| 183 |
+
return prediction
|
| 184 |
|
| 185 |
examples = [
|
| 186 |
["What are the AWS policies and frameworks regarding AI ethics, governance, and responsible AI use as detailed in their 10-K reports?", "AWS"],
|