Commit
·
8b2c047
1
Parent(s):
ef8d70b
fff
Browse files- handler.py +4 -3
handler.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
-
from inference import Chat
|
| 2 |
|
| 3 |
class EndpointHandler:
|
| 4 |
def __init__(self, path="."):
|
| 5 |
self.chat = Chat()
|
| 6 |
|
| 7 |
-
def __call__(self,
|
| 8 |
-
|
|
|
|
|
|
| 1 |
+
from inference import Chat # 你的模型类
|
| 2 |
|
| 3 |
class EndpointHandler:
|
| 4 |
def __init__(self, path="."):
|
| 5 |
self.chat = Chat()
|
| 6 |
|
| 7 |
+
def __call__(self, data):
|
| 8 |
+
inputs = data.get("inputs", data)
|
| 9 |
+
return {"results": self.chat.answer(inputs)}
|