Spaces:
Sleeping
Sleeping
Removing logging config
Browse files
app.py
CHANGED
@@ -96,19 +96,21 @@ def requestResults(text, pipeline):
|
|
96 |
import os
|
97 |
import logging
|
98 |
|
99 |
-
logging.basicConfig(
|
100 |
-
level=logging.INFO,
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
]
|
106 |
|
107 |
-
)
|
108 |
|
109 |
LOG_FILE = "usage_log.jsonl" # Use temporary file path for Hugging Face Spaces
|
110 |
|
111 |
def log_interaction(user_input, model_name, predictions):
|
|
|
|
|
112 |
log_entry = {
|
113 |
"timestamp": datetime.datetime.utcnow().isoformat(),
|
114 |
"model": model_name,
|
|
|
96 |
import os
|
97 |
import logging
|
98 |
|
99 |
+
#logging.basicConfig(
|
100 |
+
# level=logging.INFO,
|
101 |
+
# format='%(asctime)s [%(levelname)s] %(message)s',
|
102 |
+
# handlers=[
|
103 |
+
# logging.FileHandler("app.log",mode='w')
|
104 |
+
#
|
105 |
+
#]
|
106 |
|
107 |
+
#)
|
108 |
|
109 |
LOG_FILE = "usage_log.jsonl" # Use temporary file path for Hugging Face Spaces
|
110 |
|
111 |
def log_interaction(user_input, model_name, predictions):
|
112 |
+
# https://betterstack.com/community/guides/logging/how-to-start-logging-with-python/
|
113 |
+
logging.basicConfig(filename='LOG_FILE', level=logging.INFO)
|
114 |
log_entry = {
|
115 |
"timestamp": datetime.datetime.utcnow().isoformat(),
|
116 |
"model": model_name,
|