Commit
·
bb857d4
1
Parent(s):
21052af
test with seqclass
Browse files- handler.py +4 -3
handler.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
# from optimum.onnxruntime import ORTModelForSequenceClassification
|
| 3 |
-
from transformers import AutoModel
|
|
|
|
| 4 |
|
| 5 |
from transformers import pipeline, AutoTokenizer
|
| 6 |
|
|
@@ -11,8 +12,8 @@ class EndpointHandler():
|
|
| 11 |
def __init__(self, path=""):
|
| 12 |
# load the optimized model
|
| 13 |
# model = ORTModelForSequenceClassification.from_pretrained(path)
|
| 14 |
-
model = AutoModel.from_pretrained(checkpoint)
|
| 15 |
-
|
| 16 |
|
| 17 |
# tokenizer = AutoTokenizer.from_pretrained(path)
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path=checkpoint)
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
# from optimum.onnxruntime import ORTModelForSequenceClassification
|
| 3 |
+
# from transformers import AutoModel
|
| 4 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 5 |
|
| 6 |
from transformers import pipeline, AutoTokenizer
|
| 7 |
|
|
|
|
| 12 |
def __init__(self, path=""):
|
| 13 |
# load the optimized model
|
| 14 |
# model = ORTModelForSequenceClassification.from_pretrained(path)
|
| 15 |
+
# model = AutoModel.from_pretrained(checkpoint)
|
| 16 |
+
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
|
| 17 |
|
| 18 |
# tokenizer = AutoTokenizer.from_pretrained(path)
|
| 19 |
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path=checkpoint)
|