mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 00:53:25 +00:00
refactor: args
This commit is contained in:
@ -12,10 +12,12 @@ class Sentiment(Blackbox):
|
||||
def __init__(self) -> None:
|
||||
self.engine = SentimentEngine('resources/sentiment_engine/models/paimon_sentiment.onnx')
|
||||
|
||||
def valid(self, data: any) -> bool:
|
||||
def valid(self, *args, **kwargs) -> bool:
|
||||
data = args[0]
|
||||
return isinstance(data, str)
|
||||
|
||||
def processing(self, text: any) -> int:
|
||||
def processing(self, *args, **kwargs) -> int:
|
||||
text = args[0]
|
||||
return int(self.engine.infer(text))
|
||||
|
||||
async def fast_api_handler(self, request) -> Response:
|
||||
|
||||
Reference in New Issue
Block a user