Commit
•
3ca50ac
1
Parent(s):
c5f4faa
Update handler.py
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
from typing import Any, Dict, List
|
2 |
-
|
3 |
from flair.data import Sentence
|
4 |
from flair.models import SequenceTagger
|
5 |
|
6 |
class EndpointHandler():
|
7 |
def __init__(
|
8 |
self,
|
9 |
-
|
10 |
):
|
11 |
-
self.tagger = SequenceTagger.load(
|
12 |
|
13 |
def __call__(self, inputs: str) -> List[Dict[str, Any]]:
|
14 |
"""
|
|
|
1 |
from typing import Any, Dict, List
|
2 |
+
import os
|
3 |
from flair.data import Sentence
|
4 |
from flair.models import SequenceTagger
|
5 |
|
6 |
class EndpointHandler():
|
7 |
def __init__(
|
8 |
self,
|
9 |
+
path: str,
|
10 |
):
|
11 |
+
self.tagger = SequenceTagger.load(os.path.join(path,"pytorch_model.bin"))
|
12 |
|
13 |
def __call__(self, inputs: str) -> List[Dict[str, Any]]:
|
14 |
"""
|