Update handler.py
Browse files- handler.py +4 -1
handler.py
CHANGED
@@ -9,5 +9,8 @@ class EndpointHandler():
|
|
9 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
10 |
# 处理输入数据并返回预测结果
|
11 |
inputs = data.get("inputs", "")
|
12 |
-
|
|
|
|
|
|
|
13 |
return {"response": conversation.generated_responses[0]}
|
|
|
9 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
10 |
# 处理输入数据并返回预测结果
|
11 |
inputs = data.get("inputs", "")
|
12 |
+
# 使用对话模型生成响应
|
13 |
+
conversation = self.pipeline(inputs)
|
14 |
+
|
15 |
+
# 返回模型的响应
|
16 |
return {"response": conversation.generated_responses[0]}
|