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