Update handler.py
Browse files- handler.py +4 -6
handler.py
CHANGED
|
@@ -14,13 +14,11 @@ CONFIG = {
|
|
| 14 |
'do_sample': True,
|
| 15 |
}
|
| 16 |
|
| 17 |
-
class EndpointHandler
|
| 18 |
-
def __init__(self,
|
| 19 |
-
model_path: str = ".",
|
| 20 |
-
tokenizer_path: str = "."):
|
| 21 |
|
| 22 |
-
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 23 |
-
self.model = AutoModelForSeq2SeqLM.from_pretrained(
|
| 24 |
|
| 25 |
def __call__(self, data: Dict[str, str]) -> Dict[str, str]:
|
| 26 |
|
|
|
|
| 14 |
'do_sample': True,
|
| 15 |
}
|
| 16 |
|
| 17 |
+
class EndpointHandler:
|
| 18 |
+
def __init__(self, path: str = ""):
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
| 21 |
+
self.model = AutoModelForSeq2SeqLM.from_pretrained(path)
|
| 22 |
|
| 23 |
def __call__(self, data: Dict[str, str]) -> Dict[str, str]:
|
| 24 |
|