dyamagishi
commited on
Commit
•
61223da
1
Parent(s):
cb4e964
- handler.py +1 -5
handler.py
CHANGED
@@ -4,7 +4,6 @@ import holidays
|
|
4 |
|
5 |
class EndpointHandler():
|
6 |
def __init__(self, path=""):
|
7 |
-
self.pipeline = pipeline("text-classification",model=path)
|
8 |
self.holidays = holidays.US()
|
9 |
|
10 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
@@ -23,7 +22,4 @@ class EndpointHandler():
|
|
23 |
if date is not None and date in self.holidays:
|
24 |
return [{"label": "happy", "score": 1}]
|
25 |
|
26 |
-
|
27 |
-
# run normal prediction
|
28 |
-
prediction = self.pipeline(inputs)
|
29 |
-
return prediction
|
|
|
4 |
|
5 |
class EndpointHandler():
|
6 |
def __init__(self, path=""):
|
|
|
7 |
self.holidays = holidays.US()
|
8 |
|
9 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
22 |
if date is not None and date in self.holidays:
|
23 |
return [{"label": "happy", "score": 1}]
|
24 |
|
25 |
+
return [{"label": "sad", "score": 0}]
|
|
|
|
|
|