Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Add debug logging

davidmezzettif3138c27105b
diff --git a/src/python/txtai/pipeline/audio/microphone.py b/src/python/txtai/pipeline/audio/microphone.py
index bb833c4e..e37c9e1d 100644
--- a/src/python/txtai/pipeline/audio/microphone.py
+++ b/src/python/txtai/pipeline/audio/microphone.py
@@ -167,7 +167,9 @@ class Microphone(Pipeline):
# Calculate detection ratio and return
ratio = sum(detects) / len(detects) if detects else 0
- logger.debug("DETECT %.4f", ratio)
+ if ratio > 0:
+ logger.debug("DETECT %.4f", ratio)
+
return ratio >= self.vadthreshold
def detectband(self, audio):
diff --git a/src/python/txtai/pipeline/audio/texttospeech.py b/src/python/txtai/pipeline/audio/texttospeech.py
index b7e73caf..9a7f3cf6 100644
--- a/src/python/txtai/pipeline/audio/texttospeech.py
+++ b/src/python/txtai/pipeline/audio/texttospeech.py
@@ -2,6 +2,8 @@
TextToSpeech module
"""
+import logging
+
# Conditional import
try:
import onnxruntime as ort
@@ -21,6 +23,9 @@ from huggingface_hub import hf_hub_download
from ..base import Pipeline
+# Logging configuration
+logger = logging.getLogger(__name__)
+
class TextToSpeech(Pipeline):
"""
@@ -150,6 +155,9 @@ class TextToSpeech(Pipeline):
waveform as NumPy array
"""
+ # Debug logging for input text
+ logger.debug("%s", text)
+
# Tokenize input
tokens = self.tokenizer(text)