Skip to content

Commit

Permalink
chore: don't drag ovos-classifiers
Browse files Browse the repository at this point in the history
ovos-classifiers is only used in two functions, and some lightweight utilities that use workshop don't need all its dependencies. Moves the import to those specific functions and makes classifiers part of the ocp extras
  • Loading branch information
mikejgray committed Jun 8, 2024
1 parent cc68cc1 commit 7575b5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ovos_workshop/skills/common_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from ovos_utils.log import LOG

from ovos_bus_client import Message
from ovos_classifiers.skovos.features import KeywordFeatures
from ovos_config.locations import get_xdg_cache_save_path
from ovos_workshop.skills.ovos import OVOSSkill

Expand Down Expand Up @@ -205,6 +204,7 @@ def load_ocp_keyword_from_csv(self, csv_path: str, lang: str = None):
film_genre,spy film
...
"""
from ovos_classifiers.skovos.features import KeywordFeatures
if lang is None:
for lang in self.native_langs:
if lang not in self.ocp_matchers:
Expand Down Expand Up @@ -240,6 +240,7 @@ def register_ocp_keyword(self, media_type: MediaType, label: str,
ocp keywords can be efficiently matched with self.ocp_match helper method
that uses Aho–Corasick algorithm
"""
from ovos_classifiers.skovos.features import KeywordFeatures
samples = list(set(samples))
langs = langs or self.native_langs
for l in langs:
Expand Down
3 changes: 2 additions & 1 deletion requirements/ocp.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ovos_plugin_common_play
ovos_plugin_common_play
ovos_classifiers>=0.0.0a46
1 change: 0 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ ovos-bus-client < 0.1.0, >=0.0.9a20
ovos_config < 0.2.0,>=0.0.12
ovos_backend_client < 0.2.0, >=0.1.0
ovos-lingua-franca~=0.4, >=0.4.6
ovos_classifiers>=0.0.0a46
rapidfuzz

0 comments on commit 7575b5d

Please sign in to comment.