Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -106,12 +106,12 @@ def log_interaction(user_input, model_name, predictions):
|
|
| 106 |
}
|
| 107 |
|
| 108 |
try:
|
| 109 |
-
os.makedirs(os.path.dirname(LOG_FILE), exist_ok=True)
|
| 110 |
with open(LOG_FILE, "a") as log_file:
|
| 111 |
log_file.write(json.dumps(log_entry) + "\n")
|
|
|
|
| 112 |
except Exception as e:
|
| 113 |
-
print(f"
|
| 114 |
-
# You could also return a response with the error, or raise an error to stop the process
|
| 115 |
|
| 116 |
|
| 117 |
app = Flask(__name__)
|
|
|
|
| 106 |
}
|
| 107 |
|
| 108 |
try:
|
| 109 |
+
os.makedirs(os.path.dirname(LOG_FILE), exist_ok=True)
|
| 110 |
with open(LOG_FILE, "a") as log_file:
|
| 111 |
log_file.write(json.dumps(log_entry) + "\n")
|
| 112 |
+
print("[INFO] Logged interaction successfully.")
|
| 113 |
except Exception as e:
|
| 114 |
+
print(f"[ERROR] Could not write log entry: {e}")
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
app = Flask(__name__)
|