philschmid commited on
Commit
eb3cd49
·
1 Parent(s): 5c345f3

Delete endpoint.py

Browse files
Files changed (1) hide show
  1. endpoint.py +0 -22
endpoint.py DELETED
@@ -1,22 +0,0 @@
1
- from typing import Dict, List, Any
2
- from transformers import pipeline
3
-
4
- class EndpointHandler():
5
- def __init__(self, path=""):
6
- self.pipeline = pipeline("text-classification",model=path)
7
-
8
- def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
9
- """
10
- data args:
11
- inputs (:obj: `str`)
12
- date (:obj: `str`)
13
- Return:
14
- A :obj:`list` | `dict`: will be serialized and returned
15
- """
16
- # get inputs
17
- inputs = data.pop("inputs",data)
18
- date = data.pop("date", None)
19
-
20
- # run normal prediction
21
- prediction = self.pipeline(inputs)
22
- return {"inputs": inputs}