nbroad HF staff commited on
Commit
e8db095
1 Parent(s): 9a5e8b9

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -1
handler.py CHANGED
@@ -7,7 +7,11 @@ from optimum.pipelines import pipeline
7
  class EndpointHandler():
8
  def __init__(self, path=""):
9
  # load the optimized model
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, device=0)
 
7
  class EndpointHandler():
8
  def __init__(self, path=""):
9
  # load the optimized model
10
+ model = ORTModelForSequenceClassification.from_pretrained(
11
+ path,
12
+ export=False,
13
+ provider="CUDAExecutionProvider",
14
+ )
15
  tokenizer = AutoTokenizer.from_pretrained(path)
16
  # create inference pipeline
17
  self.pipeline = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)