AceVen57 commited on
Commit
325e8cd
·
verified ·
1 Parent(s): 6db5bad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
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
- 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"],
 
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"],