summaryrefslogtreecommitdiffstats
path: root/app/logger.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-07-25 21:28:50 -0700
committeryum <yum.food.vr@gmail.com>2025-07-25 21:28:50 -0700
commita7f9b7b5fb33bead6bcfb0ad6867b57f2ddc42af (patch)
tree61d4870a019acb0e545d88e7661c8a4c7d90e499 /app/logger.py
parent5df013d26eb13ed4aef8d16aa14346e0f9be5111 (diff)
Experiment with hallucination reduction
- update cursorignore - add hallucination filter training & inference code - put logging into a central module - segment metadata logging occurs before filtering - segment metadata logging is on by default - check in embedded python setup script - include trained hallucination filter model
Diffstat (limited to 'app/logger.py')
-rw-r--r--app/logger.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/logger.py b/app/logger.py
new file mode 100644
index 0000000..72a2134
--- /dev/null
+++ b/app/logger.py
@@ -0,0 +1,12 @@
+import sys
+import io
+
+sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
+sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
+
+def log(message):
+ print(message, file=sys.stdout, flush=True)
+
+def log_err(message):
+ print(message, file=sys.stderr, flush=True)
+