feat: blackbox call

This commit is contained in:
Dan Chen
2024-03-21 15:59:35 +08:00
parent 726b926d98
commit 11e1659e22
12 changed files with 49 additions and 13 deletions

View File

@ -12,6 +12,9 @@ class Sentiment(Blackbox):
def __init__(self) -> None:
self.engine = SentimentEngine('resources/sentiment_engine/models/paimon_sentiment.onnx')
def __call__(self, *args, **kwargs):
return self.processing(*args, **kwargs)
def valid(self, *args, **kwargs) -> bool:
data = args[0]
return isinstance(data, str)