Skip to content

Commit

Permalink
Update intent_manager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Dec 11, 2024
1 parent 718da8a commit b3bbe3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ovos_padatious/intent_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class IntentManager(TrainingManager):
Args:
cache (str): Path to the cache directory for storing trained models.
"""
def __init__(self, cache: str):
def __init__(self, cache: str, debug: bool = False):
super().__init__(Intent, cache)
self.debug = debug

def calc_intents(self, query: str, entity_manager) -> List[MatchData]:
"""
Expand All @@ -50,7 +51,8 @@ def match_intent(intent):
try:
match = intent.match(sent, entity_manager)
match.detokenize()
LOG.debug(f"Inference for intent '{intent.name}' took {time.monotonic() - start_time} seconds")
if self.debug:
LOG.debug(f"Inference for intent '{intent.name}' took {time.monotonic() - start_time} seconds")
return match
except Exception as e:
LOG.error(f"Error processing intent '{intent.name}': {e}")
Expand Down

0 comments on commit b3bbe3a

Please sign in to comment.