From 4c01ad46facc5c39ff27a0c1cf131f3fc18152e5 Mon Sep 17 00:00:00 2001 From: Limbo <57550280+Alu-XXX@users.noreply.github.com> Date: Mon, 13 May 2024 16:23:32 +0800 Subject: [PATCH] Update emotion.py --- src/blackbox/emotion.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/blackbox/emotion.py b/src/blackbox/emotion.py index 4d2d060..80b6966 100644 --- a/src/blackbox/emotion.py +++ b/src/blackbox/emotion.py @@ -29,8 +29,7 @@ class Emotion(Blackbox): data = args[0] return isinstance(data, str) - def processing(self, *args, **kwargs) -> int: - text = args[0] + def processing(self, text: str) -> int: text = "Please use one word to infer the emotion of the following passage:\n" + text + "\nJust print out that signle word pls." text = [{'role': 'user', 'content': text}] return self.model.stream_chat(text) @@ -47,4 +46,4 @@ class Emotion(Blackbox): text = [{'role': 'user', 'content': text}] sentiment = self.processing(text) return JSONResponse(content={"sentiment": sentiment }, status_code=status.HTTP_200_OK) - \ No newline at end of file +