YassineB commited on
Commit
5015587
·
1 Parent(s): 423dcb9

Fix requirements

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -6,13 +6,13 @@ from transformers import pipeline, AutoTokenizer
6
  class EndpointHandler():
7
  def __init__(self, path=""):
8
  # load the optimized model
9
- path = "optimum/roberta-base-squad2"
10
- model = ORTModelForSequenceClassification.from_pretrained(path)
11
  tokenizer = AutoTokenizer.from_pretrained(path)
 
12
  # create inference pipeline
13
  self.pipeline = pipeline("text-classification", model=model, tokenizer=tokenizer)
14
 
15
-
16
  def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
17
  """
18
  Args:
 
6
  class EndpointHandler():
7
  def __init__(self, path=""):
8
  # load the optimized model
9
+ path = "distilbert-base-uncased-finetuned-sst-2-english"
10
+ model = ORTModelForSequenceClassification.from_pretrained(path,from_transformers=True)
11
  tokenizer = AutoTokenizer.from_pretrained(path)
12
+
13
  # create inference pipeline
14
  self.pipeline = pipeline("text-classification", model=model, tokenizer=tokenizer)
15
 
 
16
  def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
17
  """
18
  Args: